
vsm922275 (Community Member) asked a question.

vsm922275 (Community Member) asked a question.
Ask the Community
Get answers, share a use case, discuss your favorite features, or get input from the community.
By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts.
.png)
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising.
Hello @vsm922275 (Community Member) ,
Veracode static analyzer reports CRLF injection flaws for both web applications and APIs wherever it finds that the app or API in question accepts tainted, untrusted input from outside the code itself and uses this in a context where unsafe interpretation of CRLF sequences could lead to a injection security issue. Examples of data that can originate from outside your code can include HTTP requests, reading from a database, reading from a file on a server, etc. -- basically any external source where the input handled is not part of the scanned source code upload.
There are primarily two main cases where CRLF injection is of concern. The first case happens wherever the .NET API uses and writes the untrusted input as part of an HTTP response header -- failing to validate, encode or sanitize this can result in an attack known as "HTTP Response splitting" , which gives attackers the ability to manipulate the HTTP responses returned by your application. This can lead to undesired behaviors permitted by your API depending on how it is used or consumed by other systems and services in your API runtime environment. This flaw is reported in Veracode with the label "CWE-113 Improper Neutralization of CRLF Sequences in HTTP Headers (HTTP Response Splitting)".
The second case happens whenever the API uses and write untrusted input to a server log file through a logger statement. By failing to validate, encode or sanitize this, attackers will have the ability to hijack intended logging behavior set forth in your application in order to insert fraudulent logs and cover up tracks of any bad behaviors performed inside the application. This flaw is reported in Veracode with the label "CWE-117 Improper Output Neutralization for Logs". There is also a third type of label related to CRLF injection with the label "CWE-93 Improper Neutralization of CRLF Sequences (CRLF Injection)" that is used to report other kinds of general cases that do not map to any of the first two cases but where un-sanitized CRLF sequences could still lead to a secure data handling issue. Most likely the flaw you are seeing reported for your .NET API maps to any of these three CWE categories.
Regardless of what specific type of CRLF injection flaw your API received from the Veracode scanner, the process to fix and address these flaws is the same across all of these CWEs. We suggest you apply any of the following recommendations below when responding to these types of flaws:
Finally, here are some additional references and resources on this subject that you can have a look over in order to understand this issue and how to properly fix it. Most of these guides single out CWE-117 in particular, but as said earlier, the remediation focused sections of these guides can also be applied to the other CRLF injection scenarios highlighted above.
Hopefully this helps get you started in the right direction towards fixing these kinds of findings in your Veracode scan report. If there's anything more we can help clarify here, please let us know.
Best Regards,
Andrew