Skip to content

fix(942290): add word boundary to MongoDB operator detection#4588

Merged
EsadCetiner merged 2 commits into
coreruleset:mainfrom
zoutjebot:fix/942290-mongodb-word-boundary
Apr 15, 2026
Merged

fix(942290): add word boundary to MongoDB operator detection#4588
EsadCetiner merged 2 commits into
coreruleset:mainfrom
zoutjebot:fix/942290-mongodb-word-boundary

Conversation

@zoutjebot
Copy link
Copy Markdown
Contributor

What

Add \b word boundary after MongoDB operator names to prevent matching operator prefixes in cookie values and GraphQL fields (e.g., $exists matching inside $existingUser).

Context

Part of CVE-derived payload research FP reductions. See tracking issue #4584 for full context.

Refs: #4584

Add \b word boundary after MongoDB operator names to prevent matching
operator prefixes that appear in cookie values and GraphQL field names
(e.g., \$exists matching inside \$existingUser).

Refs: coreruleset#4584
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 30, 2026

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

@zoutjebot
Copy link
Copy Markdown
Contributor Author

Fair point — these were split from a single combined PR at a maintainer's request, so they all landed at once. No more incoming.

That said, we're keen to keep contributing where it's useful. What pace works best for the team? Happy to batch future submissions or coordinate differently. Let us know how we can help.

@fzipi
Copy link
Copy Markdown
Member

fzipi commented Mar 30, 2026

I've just released v4 LTS. That was the priority. We are a bunch of developers also. It might take time to review only, just be patient.

@fzipi
Copy link
Copy Markdown
Member

fzipi commented Apr 5, 2026

@zoutjebot Can you add tests?

- Test 10:  as standalone operator still triggers (positive)
- Test 11:  in cookie does NOT trigger (word boundary fix)
- Test 12:  in JSON body does NOT trigger (word boundary fix)

Refs: coreruleset#4588
@zoutjebot
Copy link
Copy Markdown
Contributor Author

Tests added to 942290.yaml:

Test 10 (positive): POST with {"user": {"": true}} — standalone $exists operator still triggers. Verifies the word boundary doesn't break legitimate detection.

Test 11 (negative): Cookie with $existingUser=admin does NOT trigger. This is the core FP case — $exists matching as a prefix inside a longer variable name.

Test 12 (negative): POST body with {"": "foo"} does NOT trigger. Another prefix match FP case with a made-up but realistic field name.

Copy link
Copy Markdown
Member

@Xhoenix Xhoenix left a comment

Choose a reason for hiding this comment

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

Looks good.

@EsadCetiner EsadCetiner added this pull request to the merge queue Apr 15, 2026
Merged via the queue into coreruleset:main with commit 16d58be Apr 15, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants