我在接受 JMS 消息的 onMessage() 方法中的 checkmarx 扫描(在代码中找到与安全相关的漏洞)期间对不受信任的数据进行反序列化:
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public void onMessage(Message message) {
log.debug("Code Run Started - In Queue");
if (message instanceof ObjectMessage) {
ObjectMessage objMes = (ObjectMessage) message;
try {
ChangeOperationType changeOperation = null;
changeOperation = (ChangeOperationType) objMes.getObject();
} catch (JMSException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
log.error("Message Type is incorrect (Not ChangeOperationType). ", e1);
}
try {
callBackEndpoint = message.getStringProperty(CRMCommonProcessing.CALLBACK_ENDPOINT_URI_PROPERTY);
} catch (JMSException e) {
log.error("CALLBACK ENDPOINT VALUE ERROR. ", e);
}
change(changeOperation);
} else {
log.error("WRONG MESSAGE TYPE GIVEN");
}
log.debug("Code Run Complete - In Queue");
}
该问题的任何修复或解决方案?