-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Reduce false positives count in security reports #3851
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It was being incorrectly detected as used in a dangerous send. We can get rid of the warning by taking advantage of the `has_orders` method and getting rid of this code.
This was actually a false positive, since our new regular expression does the exact same thing. However, false positives generate noise and make it harder to deal with real issues, so I'm changing it anyway. We could add a more advanced regular expression, like `URI::MailTo::EMAIL_REGEXP`. However, this expression marks emails with non-English characters as invalid, when in practice it's possible to have an email address with non-English characters.
javierm
changed the title
Reduce number of false positives in security reports
Decrease false positives in security reports
Nov 13, 2019
javierm
changed the title
Decrease false positives in security reports
Reduce false positives count in security reports
Nov 13, 2019
javierm
force-pushed
the
security
branch
2 times, most recently
from
November 13, 2019 02:30
14f201a
to
c3740ad
Compare
We make the code easier to read and at the same time we remove a SQL injection false positive regarding the use of `WHERE id = #{id}`. We still get a warning about SQL injection regarding the `tsv =` part. It's a false positive, since the value of that parameter does not depend on user input.
Using `sanitize` we make sure the `href` attribute does not execute any dangerous code. The possibility of a banner pointing to a dangerous URL was very reduced, though, since only administrators can edit this attribute.
In this case using `joins` doesn't prevent N+1 queries to get titles for every record, and since we cannot order translations with just SQL due to fallbacks, we don't need it. Automatic SQL injection checks were showing a false positive in this scope; there was no real vulnerability here because foreign keys, table names and locales were under our control.
smarques
pushed a commit
to venetochevogliamo/consul
that referenced
this pull request
Apr 29, 2020
Reduce false positives count in security reports
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
Some security tools like brakeman generate automatic reports containing possible security vulnerabilities. While many of them are false positives, they generate noise which makes it hard to focus on real vulnerabilities.
Objectives
Notes
There are still a few false positives, related to SQL injection and dynamic render paths. We might address them in the future.