fortify漏洞修复笔记

时间:2025-01-30 21:42:55

randomness 不安全随机数

解决方法:使用SecureRandom sr = new SecureRandom() 替换Random sr = new Random()

Specifier Manipulation 漏洞成因:(true)  ,AccessibleObject允许程序员绕过由java说明符提供的access control检查。并反过来更改私有字段或调用私有方法、行为。

解决方法:使用 的 makeAccessible 方法来更改属性的访问修饰符。(field);

3.新建工具类,封装jar包,解决扫描问题,针对不好改的。

Violation: Heap Inspection 隐私泄露

解决方法 使用stringbuffer

resource streams 未释放资源

解决方法 我遇到的是getresourceasstream,在finally释放资源