我的静态扫描给出了一个漏洞,表明我正在将未经验证的输入写入 JSON。它建议使用安全的序列化函数执行 JSON 的所有序列化,该函数在单引号或双引号内分隔不受信任的数据并转义任何特殊字符。
知道如何最好地做到这一点吗?我已经检查了通常的 ESAPI 类和 StringUtils 方法,但 Json 没有什么。http 响应来自公司内部 BTW。我什至找不到关于这个话题的讨论方式或解决方案。
HttpEntity entity = response.getEntity();
objectMapper.readValue(entity.getContent(), MyObj.class);
Run Code Online (Sandbox Code Playgroud) 我正在尝试从看似简单的Java代码创建主题发布者时遇到问题.我的WMQ在公司单独管理,所以我没有直接控制它.
我尝试通过使用相当标准的Java代码创建a TopicConnection,然后a TopicSession然后a 来连接到主题,TopicPublisher尽管通过SSL设置一些额外的系统道具.但是我有相同的问题,有或没有SSL我相当肯定.
在线上
this.topicPublisher = this.topicPublisherSession.createPublisher(this.topic);
Run Code Online (Sandbox Code Playgroud)
提出WMQ异常如下
Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:209)
Run Code Online (Sandbox Code Playgroud)
WMQ管理员可以通过授权来为我提供"修复" SYSTEM.BASE.TOPIC.但是,公司风险政策不允许这样做.
有人问我为什么需要访问基本主题,但当然我不需要访问权限.我只需要发布到我的主题.
任何WMQ专家都有其他想法吗?非常感谢.
请问这个设置有什么明显的错误吗?在应用程序启动时,我得到属性“命名空间”必须为元素类型“映射器”声明,当它明确声明时。
spring xml资源dao.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:jms="http://www.springframework.org/schema/jms"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.2.xsd
http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-2.5.xsd">
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/JNDINAME"/>
<property name="lookupOnStartup" value="true"/>
<property name="cache" value="true"/>
<property name="proxyInterface" value="javax.sql.DataSource"/>
</bean>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="mapperScanner" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.mycompany.dao"/>
<property name="sqlSessionFactory" ref="sqlSessionFactory"/>
</bean>
</beans>
Run Code Online (Sandbox Code Playgroud)
界面:
public interface MyDAO {
public void save(@Param("id") String id);
}
Run Code Online (Sandbox Code Playgroud)
映射器xml:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<mapper namespace="com.mycompany.dao">
<typeAlias alias="xxxVO" …Run Code Online (Sandbox Code Playgroud)