Skip to content
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

Fix false positive on SQLi EOL comments #330

Merged
merged 3 commits into from
Aug 2, 2024
Merged

Conversation

Anilm3
Copy link
Collaborator

@Anilm3 Anilm3 commented Aug 2, 2024

If an injection is within a comment, it can be matched as a false positive if the comment is not the first or last token in the resource. To avoid these false positives, we must ensure that the comment itself was part of the injection and / or more than one token was injected.

Related Jiras: APPSEC-54410

@Anilm3 Anilm3 requested a review from a team as a code owner August 2, 2024 14:31
@codecov-commenter
Copy link

codecov-commenter commented Aug 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.51%. Comparing base (87d3e77) to head (35dbe34).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #330   +/-   ##
=======================================
  Coverage   84.50%   84.51%           
=======================================
  Files         144      144           
  Lines        6946     6948    +2     
  Branches     3182     3182           
=======================================
+ Hits         5870     5872    +2     
  Misses        400      400           
  Partials      676      676           
Flag Coverage Δ
waf_test 84.51% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pr-commenter
Copy link

pr-commenter bot commented Aug 2, 2024

Benchmarks

Benchmark execution time: 2024-08-02 15:04:24

Comparing candidate commit 00792d1 in PR branch anilm3/fix-sqli-fp with baseline commit 87d3e77 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

Copy link
Collaborator

@Taiki-San Taiki-San left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any case where is_not_last_token is useful. Unless the test suite complain, I think it may be a Sqreen bug

src/condition/sqli_detector.cpp Outdated Show resolved Hide resolved
src/condition/sqli_detector.cpp Outdated Show resolved Hide resolved
src/condition/sqli_detector.cpp Outdated Show resolved Hide resolved
@Anilm3 Anilm3 merged commit 9332b9d into master Aug 2, 2024
49 of 50 checks passed
@Anilm3 Anilm3 deleted the anilm3/fix-sqli-fp branch August 2, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants