DJ (Community Member) asked a question.

Supported cleansing functions C# CWE-117

In the list of supported cleansing functions for CWE-117, https://docs.veracode.com/r/Supported_NET_Cleansing_Functions, there are some which do not really solve the issue (or I'm missing something)

For instance there is System.Security.SecurityElement.Escape (which again the page explicitly mentions this can be used for solving CWE-117), however SecurityElement.Escape doesn't replace newlines in strings, which CWE-117 is all about.

 

if I run for example:

Console.WriteLine(System.Security.SecurityElement.Escape("Line 1\r\nLine 2"));

 

the output is:

Line 1

Line 2

 

including the newline which should've been be escaped. What am I missing?


Topics (2)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.