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 @sdomde213606 (Community Member),
Thanks for your question.
The flaw is being raised because the commandArray parameter contains data from an untrusted source, such as an HTTP request, a configuration file or database. Where possible the recommendation is to not allow the end user or consumer of the service to arbitrarily specify the executable or it's parameters to prevent malicious input from being injected and executed. If you must rely on data from untrusted sources, sufficient validation must be in place such as the use of allow-lists to mitigate the flaw.
I answered a similar question to this yesterday which may be useful for you: https://community.veracode.com/s/question/0D52T000054VCt8SAG/whats-causing-an-os-command-injectioncwe78-flaw-in-the-following-c-code.
Please note that Veracode Static Analysis is unable to verify the changes you have made sufficiently remove the risk from taking untrusted user input and executing it. The resolution for each instance is contextual to how the application processes the untrusted input, and so you will always be required to propose a mitigation. Such proposal should clearly state all the controls in place to mitigate the risk.
I hope that answers your question.
Thanks,
Anthony Fielding