fortify

Fortify error on JSON Injection in Java

给你一囗甜甜゛ 提交于 2019-12-01 17:29:56
I am getting SUBSCRIPTION_JSON from client which I am converting it to String and then setting it to Model Object using gson library. On running the code on Fortify security, It is giving me Json injection error on below code with following message : Here is the error : On line 159 of ActionHelper.java, the method jsonToObject() writes unvalidated input into JSON. This call could allow an attacker to inject arbitrary elements or attributes into the JSON entity.The method writes unvalidated input into JSON. This call could allow an attacker to inject arbitrary elements or attributes into the

HP Fortify — annotating method parameters

风流意气都作罢 提交于 2019-12-01 16:10:35
问题 I'm trying to eliminate false-positives from an HP Fortify scan of a Java application. This method causes a "Privacy Violation" issue (the PrintWriter is a servlet response) private void writeOutput(String passwordRules, PrintWriter out) { ... out.print(passwordRules); ... } This is because Fortify follows naming conventions, to decide that passwordRules contains private data. But my passwordRules is not private data -- it contains stuff like "Minimum 8 characters". I can make the error go

Can't resolve Log Forging Fortify issue

邮差的信 提交于 2019-12-01 05:04:27
问题 I am having trouble fixing a Log Forging issue in Fortify. The issue, "writes unvalidated user input to the log", is being raised from both of the logging calls in the getLongFromTimestamp() method. public long getLongFromTimestamp(final String value) { LOGGER.info("getLongFromTimestamp(" + cleanLogString(value) + ")"); long longVal = 0; Date tempDate = null; try { tempDate = new SimpleDateFormat(FORMAT_YYYYMMDDHHMMSS, Locale.US).parse(value); } catch (ParseException e) { LOGGER.warn("Failed

ESAPI for XSS prevention not working

白昼怎懂夜的黑 提交于 2019-11-30 05:57:00
I am working on fixing Cross site scripting issues in our code mainly in JSPS. Below is the original code //scriplet code <% String userId = request.getParameter("sid"); ...%> and in the same Jsp they have <input type = hidden name = "userID" value = "<%= userId %>" /> I have made changes to include esapi-2.1.0.jar in lib and ESAPI.properties, validation.properties in classpath. Then made below changes to scriplet code to fix the above code //scriplet code <% String userId = ESAPI.encoder().encodeForHTML(request.getParameter("sid")); ...%> I thought this would fix the issue but when I scan my

ESAPI for XSS prevention not working

二次信任 提交于 2019-11-29 05:37:12
问题 I am working on fixing Cross site scripting issues in our code mainly in JSPS. Below is the original code //scriplet code <% String userId = request.getParameter("sid"); ...%> and in the same Jsp they have <input type = hidden name = "userID" value = "<%= userId %>" /> I have made changes to include esapi-2.1.0.jar in lib and ESAPI.properties, validation.properties in classpath. Then made below changes to scriplet code to fix the above code //scriplet code <% String userId = ESAPI.encoder()

Fortify command line usage

我的梦境 提交于 2019-11-28 06:57:21
Has anyone used command line to run fortify? I tryin to incorporate fortify run in my CI build and I dont know how to do it. AspiringDevOpsGuru Since I can't add a comment, I'll have to offer this as an answer. Our company has integrated the scan process into our TFS build environment and it works pretty well. We use a series of "Invoke Process" build activities to make this happen. The entire security scan sequence is wrapped in a conditional which is exposed as an argument to the build definition. This allows us to enable or disable scans as needed. We also expose a few other things like

How to fix Mass Assignment: Insecure Binder Configuration (API Abuse, Structural) in java

风格不统一 提交于 2019-11-28 04:00:33
问题 I have a Controller class with the below two methods for finding a doctors (context changed). Getting the Mass Assignment: Insecure Binder Configuration (API Abuse, Structural) error on both methods. @Controller @RequestMapping(value = "/findDocSearch") public class Controller { @Autowired private IFindDocService findDocService; @RequestMapping(value = "/byName", method = RequestMethod.GET) @ResponseBody public List<FindDocDTO> findDocByName(FindDocBean bean) { return findDocService

Fortify command line usage

萝らか妹 提交于 2019-11-27 01:37:37
问题 Has anyone used command line to run fortify? I tryin to incorporate fortify run in my CI build and I dont know how to do it. 回答1: Since I can't add a comment, I'll have to offer this as an answer. Our company has integrated the scan process into our TFS build environment and it works pretty well. We use a series of "Invoke Process" build activities to make this happen. The entire security scan sequence is wrapped in a conditional which is exposed as an argument to the build definition. This