When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
Hi @AAli910913 (Community Member) ,
Veracode Static Analysis will report CWE 78 Improper Neutralization of Special Elements used in an OS Command (OS Command Injection) if it can detect that there are strings from outside of the application (HTTP Request, File, Database, webservice, etc.) being used in a command or it's arguments.
We recommend hardcoding allowed inputs and using only hardcoded data in OS commands executed by the application.
If this is not possible and you must allow some dynamic inputs, then we recommend adding strict allowlist validation and proposing a mitigation ( https://docs.veracode.com/r/Propose_Mitigating_Factors_for_a_Flaw ) on this flaw from the Veracode Platform or IDE plugin. In this proposal please describe the controls you have in place to prevent an attacker from abusing this functionality. Then contact your security team to have these proposals reviewed.
Please note that the example above appears to perform arbitrary commands on arbitrary hosts as arbitrary users. This can be extremely dangerous and I would recommend verifying you have appropriate controls over "username" (for example, can only be "alice" or "bob"), host (for example can only be "dev-machine1" or "dev-machine2") and command (for example can only be "rm /var/local/cache/myapp/*").
Fixing this flaw can be deceptively hard. Please consider Scheduling a Consultation ( https://docs.veracode.com/r/t_schedule_consultation ) to meet with one of our Veracode Application Security Consultants to discuss this flaw and any other flaws you'd like to remediate.
Thank you,
Boy Baukema