
Static Analysis Group (Archived) — KMarx873727 (Community Member) asked a question.
Hi,
I've downloaded and installed the Java annotations for custom cleansing functions per this link: https://help.veracode.com/reader/DGHxSJy3Gn3gtuSIN2jkRQ/xrEjru~XmUHpO6~0FSae2Q, but when I use them for, say a CWE ID 601 redirect flaw, the flaw still shows up in Greenlight or the static scan.
E.g., The following does not work for me:
@RedirectURLCleanser
public static String validateRedirectUrl(String url) {
String cleansedUrl = shakesOutWhiteTurnsBlue(url);
}
private void myFlawdMethod(HttpResponse response, String url) {
...
response.sendRedirect( SecurityValidator.validateRedirectUrl(url) );
....
}
Thanks for any hints.
.png)
Hello -
Assuming you return "cleansedUrl", your usage looks correct.
I recommend checking with your internal security team or Veracode administrator to ensure the Custom Cleansers functionality is enabled within your account. The security team has the ability to control what action is taken when a Custom Cleanser is encountered; by default it is set to "take no action."
Thanks for the reply, Matt. Yes, the method would return "cleansedUrl" (sorry for sloppy example). When you say the default is "take no action", does that mean do or don't honer the annotation? If "the security team" needs to enable working annotations, then I think you're saying that Greenlight will always report flaws for these, since my understanding is that there's no way for it to be configured with custom security team configuration.
Thanks,
Ken
The default "take no action" means the annotation will not be respected by the scanner. Flaws will continue to show as if no cleansing methods were used.
You are correct that custom cleansers will not be recognized by Greenlight. At this time, Greenlight has no concept of mitigations and will only report potential flaws found within the limited scope of the scan (i.e. class or package). You can use the "ignore" functionality built into Greenlight to suppress findings that rely on a custom cleanser; once you perform a full static scan, the custom cleansers will be recognized appropriately (assuming the feature is enabled).
Are there any news regarding this? Having different places to add ignore flags and different Results for Greenlight scans and Online Scans is painful.