Skip to content
Advertisement

Checkmarx – How to validate and sanitize HttpServletRequest .getInputStream to pass checkmarx scan

Following are checkmarx issue details Unrestricted File Upload

Source Object : req (Line No – 39)

target Object : getInputStream (Line No -41)

JavaScript

request objects get highlighted in checkmarx tool –

How do I properly validate, filter, escape, and/or encode user-controllable input to pass a Checkmarx scan?

Advertisement

Answer

This worked for me – checkmarx pass this high vulnerability

I used combination of @reflexdemon ans and @tgdavies comment

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement