I’ve to resolve this owasp vulnerability ‘Change this code to not construct the path from user-controlled data.’ i’ve tried to use ESAPI library but sonar still shows the vulnerability, then i managed to solve this using regex and sonar no more shows the issue but if i extract the regex code into a function and call it , sonar shows again the vulnerability. images below depicts this:
- Try to fix issue with ESAPI
-
Try to fix issue with regex
-
export regex into function