Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

Fix FP in 941130 and rearrange regex with new regex-assemble file #1701

Merged
merged 2 commits into from
Feb 26, 2020

Conversation

dune73
Copy link
Contributor

@dune73 dune73 commented Feb 26, 2020

This fixes #1582.

This was done during the 4th CRS / ModSecurity Meetup in Bern (participants: @franbuehler, @theseion, @zugao, @srueg, @dune73 and Roger and Marc).

The fix is done on the fact that the base64 string is only useful as an exploit within inline encoding of payloads via base64 and that always starts with ;base64. We have thus put a semicolon in front.
See for example: https://www.bigfastblog.com/embed-base64-encoded-images-inline-in-html

Then we rearranged the slightly odd regex with the help of a new regexp-assemble data file.

tmp

Comment on lines 6 to 8
(?i)[\s\S]data:text\/html\b
(?i)[\s\S]formaction\b
(?i)[\s\S]\@import\b
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you mind dropping the escape for / and @?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure thing. We did not care enough to fix it initially. Good you noticed....

@fzipi
Copy link
Contributor

fzipi commented Feb 26, 2020

LGTM now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rule 941130: False positive
3 participants