Skip to content

fix(941120): new regex is eligible for Paranoia Level 1#4291

Merged
fzipi merged 16 commits into
coreruleset:mainfrom
touchweb-vincent:patch-11
Jan 26, 2026
Merged

fix(941120): new regex is eligible for Paranoia Level 1#4291
fzipi merged 16 commits into
coreruleset:mainfrom
touchweb-vincent:patch-11

Conversation

@touchweb-vincent
Copy link
Copy Markdown
Contributor

@touchweb-vincent touchweb-vincent commented Oct 16, 2025

Hello,

The new regex for rule 941120 has resolved most of the issues previously associated with it - including the erratic Base64 triggers.

Since 941100 remains quite tricky in terms of false positives, I don’t really understand why a rule that now produces fewer false positives than a PL1 rule is still classified under PL2.

Therefore, I’d like to suggest moving it down to Paranoia Level 1 - it’s a sensitive rule that should ideally be active even at the lowest paranoia level.


This regex has been updated on 4.0.0. The previous regex on https://github.com/coreruleset/coreruleset/releases/tag/v3.3.7 was :

(?i)[\s\"'`;\/0-9=\x0B\x09\x0C\x3B\x2C\x28\x3B]on[a-zA-Z]+[\s\x0B\x09\x0C\x3B\x2C\x28\x3B]*?=

This old regex was wrongly tagged as PL1 IMO - should have been in PL2 because of its false positives. Then you decided to move it to PL2.

The new one since 4.0.0 is : https://github.com/coreruleset/coreruleset/blob/main/rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf#L837

(?i)[\s\"'`;/0-9=\x0B\x09\x0C\x3B\x2C\x28\x3B]on[a-zA-Z]{3,50}[\s\x0B\x09\x0C\x3B\x2C\x28\x3B]*?=[^=]

In my opinion, there’s no reason for this new regex to be in PL2 - it only inherits the false-positive history of the previous one, which is no longer relevant.

What do you think?

Vincent

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 16, 2025

📊 Quantitative test results for language: eng, year: 2023, size: 10K, paranoia level: 1:
🚀 Quantitative testing did not detect new false positives

@azurit
Copy link
Copy Markdown
Member

azurit commented Oct 17, 2025

This needs to be discussed - adding it to the agenda of next monthly chat.

@touchweb-vincent
Copy link
Copy Markdown
Contributor Author

@RedXanadu The PR has been updated with both the old and new regex.

I don’t have the energy to find the commit - it’s somewhere between branches 3 and 4. : v3.3.7...v4.0.0

@github-actions github-actions Bot added the Stale label Jan 8, 2026
@github-actions github-actions Bot closed this Jan 22, 2026
@fzipi fzipi reopened this Jan 22, 2026
@fzipi fzipi removed the Stale label Jan 22, 2026
Comment thread rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf
fzipi
fzipi previously approved these changes Jan 24, 2026
Copy link
Copy Markdown
Member

@fzipi fzipi left a comment

Choose a reason for hiding this comment

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

I agree that this was mostly because of base64 encoded requests. No this should be less problematic and it is probably reasonable to move to PL1.

I would say let's merge and see what 4.23.0 gives us.

⚠️ This might end up in the 4.25.0 LTS version, so please report ASAP the results when using 4.23.0.

@EsadCetiner
Copy link
Copy Markdown
Member

@fzipi My anecdotal experience with this rule is that the false positives are quite rare with this rule.

⚠️ This might end up in the 4.25.0 LTS version, so please report ASAP the results when using 4.23.0.

If your concerned about false positives then delay then we should delay this change until after the LTS release.

@touchweb-vincent
Copy link
Copy Markdown
Contributor Author

@EsadCetiner the old CRS 3 regex was a false-positive nightmare in e-commerce contexts, where hashes, tokens, and RSA signatures are particularly common. I think this understandably traumatized quite a few integrators - rightly so. However, the regex has evolved and is now significantly simpler; we just need to be pedagogical with integrators who were impacted by that past experience.

@fzipi
Copy link
Copy Markdown
Member

fzipi commented Jan 25, 2026

I think more or less the same as @touchweb-vincent, but just to be sure, can you add some more tests involving exactly what you mentioned? E.g. "hashes, tokens, and RSA signatures..".

@touchweb-vincent
Copy link
Copy Markdown
Contributor Author

I haven’t had this kind of dataset for years anymore, but I added a Base64 payload that used to trigger the old regex - representative of what we had to deal with in an e-commerce context, for example with payment gateway callbacks.

@fzipi
Copy link
Copy Markdown
Member

fzipi commented Jan 25, 2026

Well, ended up adding some more tests. Even without artificial XSS patterns, these tests verify that:

  1. Long base64/hex strings with = padding don't trigger false positives
  2. Payment gateway data structures (URL-encoded forms, JSON webhooks) work correctly
  3. Various header types (Authorization, custom webhook signatures) are handled properly
  4. The [^=] fix in the regex properly prevents matching on base64 padding (= or ==)

The tests somehow represent realistic payment gateway callbacks that could legitimately appear in production e-commerce systems.

Copy link
Copy Markdown
Member

@fzipi fzipi left a comment

Choose a reason for hiding this comment

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

LGTM now.

@fzipi fzipi added this pull request to the merge queue Jan 26, 2026
Merged via the queue into coreruleset:main with commit bc7df45 Jan 26, 2026
8 checks passed
@touchweb-vincent touchweb-vincent deleted the patch-11 branch January 26, 2026 11:49
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