-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SemgrepParser.convert_severity has broken logic #11218
Comments
Could we close this @bsterne ? |
I am a security researcher at Semgrep. I can give some additional information about the metadata that we add to our SAST rules if this can be helpful. The rule author sets the likelihood and the impact of a rule. These two values are based on the vulnerability the rule is trying to catch. They are usually decided by the CWE the rule is targeting. But they are sometimes manually overridden by the rule author. The likelihood and impact are used to compute the severity automatically. We don't publish in our docs what the actual computation looks like, because this is not set in stone. It is sometimes overridden or might still change in the future. But for the majority of rules it looks like this:
The confidence level is also set by rule author but is more a value to describe the rule, rather than the vulnerability it is trying to catch. It is a score to reflect how confident the rule writer is that these patterns will capture the vulnerability and not result in too many False Positives. Right now this is done manually, and many of our advanced taint mode rules end up being HIGH confidence. However, this might change as well. I think this could, for example, at some point be automated based on the actual triage rate of our customers. |
We don't currently use the
|
Bug description
convert_severity tries to map a Semgrep finding to a DefectDojo severity level. There are several tests at the end of the function that will never return
True
.Steps to reproduce
Steps to reproduce the behavior:
upper_value
is statically defined in the first line of the functionif upper_value == "INFO":
it doesn't make sense to compare it with other strings.Expected behavior
I believe a different property needs to be passed in an tested, but it's unclear what the correct behavior is. It is clear that this logic is wrong.
Deployment method (select with an
X
)The text was updated successfully, but these errors were encountered: