8000 feat: target Unix commands in Referer header explicitly by theseion · Pull Request #3300 · coreruleset/coreruleset · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: target Unix commands in Referer header explicitly #3300

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

Merged
merged 3 commits into from
Sep 12, 2023

Conversation

theseion
Copy link
Contributor
@theseion theseion commented Sep 9, 2023

New rules 932205, 932206 to handle the Referer header explicitly.

The regular expression in 932200 leads to false positives against URLs
with query strings (due to the ?). 932205 uses an additional prefix in
the regular expression that matches the first ? so that the following
expressions will only match question marks that are part of the payload.

932206 uses an additional prefix to match only when the Referer value is
not a URL (which is illegal). 932206 is thus equivalent to 932200 but is
required to distinguish the case where the Referer header does actually
contain a URL.

Fixes #3180.

New rules 932205, 932206 to handle the Referer header explicitly.

The regular expression in 932200 leads to false positives against URLs
with query strings (due to the `?`). 932205 uses an additional prefix in
the regular expression that matches the first `?` so that the following
expressions will only match question marks that are part of the payload.

932206 uses an additional prefix to match only when the Referer value is
not a URL (which is illegal). 932206 is thus equivalent to 932200 but is
required to distinguish the case where the Referer header does actually
contain a URL.

Fixes coreruleset#3180
Copy link
Contributor
@franbuehler franbuehler left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you!

@dune73
Copy link
Member
dune73 commented Sep 12, 2023

Thanks for the reviews and the PR @theseion. Merging now.

@dune73 dune73 merged commit 1fe255d into coreruleset:v4.0/dev Sep 12, 2023
theseion added a commit to theseion/coreruleset that referenced this pull request Sep 17, 2023
In coreruleset#3300 a false positive in 932200 was fixed and tests were written to
ensure that the FP was fixed but the tests target 932205 and 932206.
This commit adds the same FP tests to 932200, the rule that originally
exhibited the FPs.
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.

Rule 932200, now inspecting Referer headers, matches any query string that contains spaces
4 participants
0