Skip to content

fix(932): remove w from Unix no-arguments command list#4592

Merged
theseion merged 4 commits into
coreruleset:mainfrom
zoutjebot:fix/932-remove-w-noarguments
Jul 22, 2026
Merged

fix(932): remove w from Unix no-arguments command list#4592
theseion merged 4 commits into
coreruleset:mainfrom
zoutjebot:fix/932-remove-w-noarguments

Conversation

@zoutjebot

Copy link
Copy Markdown
Contributor

What

Single letter 'w' (who-is-logged-on) causes excessive FPs. Related 'who' and 'whoami' remain for better signal.

Context

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

Refs: #4584

@github-actions

github-actions Bot commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

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

@fzipi

fzipi commented Mar 30, 2026

Copy link
Copy Markdown
Member

@theseion What do you think about this one?

Comment thread regex-assembly/include/unix-shell-noarguments.ra
@theseion

Copy link
Copy Markdown
Contributor

@theseion What do you think about this one?

Makes sense, we exclude w in the other PL1 rules as well. It might have been an oversight to not exclude it.

@fzipi

fzipi commented Apr 8, 2026

Copy link
Copy Markdown
Member

ping @zoutjebot

@EsadCetiner

Copy link
Copy Markdown
Member

@zoutjebot Can you add negative tests based on the false positives you encountered?

Add w to unix-shell-noarguments-fps-pl1.ra exclusion list instead
of removing it from the main command list. This keeps w detected at
PL2+ while preventing false positives at PL1 where ?w= is common
in legitimate query parameters (width, weight, search terms).

Addresses review feedback from theseion and EsadCetiner on PR coreruleset#4592.

Changes:
- Add w to regex-assembly/exclude/unix-shell-noarguments-fps-pl1.ra
- Regenerate .conf via crs-toolchain
- Add negative tests: ?w=value (GET), w=640 (POST form)
- Add positive test: ;who still detected at PL1
@zoutjebot
zoutjebot force-pushed the fix/932-remove-w-noarguments branch from 77ae16e to 788f70e Compare April 17, 2026 14:40
@zoutjebot

Copy link
Copy Markdown
Contributor Author

Addressed both review points:

@theseion — moved the change to the correct file. w is now added to regex-assembly/exclude/unix-shell-noarguments-fps-pl1.ra instead of being removed from the main command list. This keeps w detected at PL2+ while excluding it at PL1.

@EsadCetiner — added negative tests based on the false positive patterns:

  • ?w=hello+world (GET query param, common for search/width)
  • w=640&h=480 (POST form data, dimension parameters)
  • Plus a positive test confirming who is still detected at PL1

Rebased on latest main and regenerated .conf via crs-toolchain.

@EsadCetiner

Copy link
Copy Markdown
Member

@zoutjebot Looking at the tests, none of the false positive tests your adding are actually currently false positives.
curl -H "x-format-output: txt-matched-rules" https://sandbox.coreruleset.org -d 'w=640&h=480'

The PL-1 requires an evasion prefix before it blocks a command with no arguments

$ curl -H "x-format-output: txt-matched-rules" https://sandbox.coreruleset.org -d ';w=640&h=480'
932340 PL1 Remote Command Execution: Direct Unix Command Execution (No Arguments)
949110 PL? Inbound Anomaly Score Exceeded (Total Score: 5)
980170 PL? Anomaly Scores: (Inbound Scores: blocking=5, detection=5, per_pl=5-0-0-0, threshold=5) - (Outbound Scores: blocking=0, detection=0, per_pl=0-0-0-0, threshold=4) - (SQLI=0, XSS=0, RFI=0, LFI=0, RCE=5, PHPI=0, HTTP=0, SESS=0, COMBINED_SCORE=5)

Only at PL-3 are commands with no arguments blocked without an evasion prefix:

$ curl -H "x-format-output: txt-matched-rules" -H "x-crs-paranoia-level: 3" https://sandbox.coreruleset.org -d
 'w=640&h=480'
932350 PL3 Remote Command Execution: Direct Unix Command Execution (No Arguments)
949110 PL? Inbound Anomaly Score Exceeded (Total Score: 5)
980170 PL? Anomaly Scores: (Inbound Scores: blocking=5, detection=5, per_pl=0-0-5-0, threshold=5) - (Outbound Scores: blocking=0, detection=0, per_pl=0-0-0-0, threshold=4) - (SQLI=0, XSS=0, RFI=0, LFI=0, RCE=5, PHPI=0, HTTP=0, SESS=0, COMBINED_SCORE=5)

@HackingRepo

HackingRepo commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

i see all those FPs are not true

relunsec@relunsec:~$ curl -H "x-format-output: txt-matched-rules" https://sandbox.coreruleset.org -d 'w=640&h=480' -H "x-crs-paranoia-level: 2" -i
HTTP/1.1 405 Method Not Allowed
Date: Sun, 19 Apr 2026 20:02:15 GMT
Content-Type: text/plain; charset=iso-8859-1
Transfer-Encoding: chunked
Connection: keep-alive
X-Unique-ID: aeU0xzaTAovO3v6zz34g1gAAAA8
Allow: TRACE
x-backend: apache-v4-lts

^[[Arelunsec@relunsec:~$ curl -H "x-format-output: txt-matched-rules" https://sandbox.coreruleset.org/?w=640 -i
HTTP/1.1 200 OK
Date: Sun, 19 Apr 2026 20:02:28 GMT
Content-Type: text/plain; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
X-Unique-ID: aeU01MwsS20qcJ4UfDwXNQAAAMg
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Security-Policy: default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' camo.githubusercontent.com
x-backend: apache-v4-lts

relunsec@relunsec:~$ curl -H "x-format-output: txt-matched-rules" https://sandbox.coreruleset.org/?query=w -i
HTTP/1.1 200 OK
Date: Sun, 19 Apr 2026 20:02:46 GMT
Content-Type: text/plain; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
X-Unique-ID: aeU05jaTAovO3v6zz34g1wAAABA
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Security-Policy: default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' camo.githubusercontent.com
x-backend: apache-v4-lts

relunsec@relunsec:~$ curl -H "x-format-output: txt-matched-rules" https://sandbox.coreruleset.org/?error=wireless+password+invalid -i
HTTP/1.1 200 OK
Date: Sun, 19 Apr 2026 20:03:13 GMT
Content-Type: text/plain; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
X-Unique-ID: aeU1ATaTAovO3v6zz34g2AAAABc
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Security-Policy: default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' camo.githubusercontent.com
x-backend: apache-v4-lts

relunsec@relunsec:~$ 

relunsec@relunsec:~$ touch w
relunsec@relunsec:~$ curl -F "file_field=@w" https://sandbox.coreruleset.org/upload -i  -H "x-format-output: txt-matched-rules"
HTTP/1.1 404 Not Found
Date: Sun, 19 Apr 2026 20:07:55 GMT
Content-Type: text/plain; charset=iso-8859-1
Transfer-Encoding: chunked
Connection: keep-alive
X-Unique-ID: aeU2GzaTAovO3v6zz34g2gAAAAM
x-backend: apache-v4-lts

relunsec@relunsec:~$ 

on all FP fuzzing tests, that is allowed, only with ;w with is rarely to cause FP, that PR not need to be backported to LTS

@fzipi

fzipi commented May 25, 2026

Copy link
Copy Markdown
Member

@zoutjebot Do you have some time to fix the tests as asked?

@EsadCetiner

Copy link
Copy Markdown
Member

@zoutjebot Can you add a negative test which checks for a referer header containing https://example.com/?keyword=w?

We just had a report of a similar false positive in the CRS slack.

@github-actions

Copy link
Copy Markdown
Contributor

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

@EsadCetiner EsadCetiner self-assigned this Jul 21, 2026
@EsadCetiner

Copy link
Copy Markdown
Member

I'm taking this PR over since the Author isn't around to respond to feedback.

@EsadCetiner
EsadCetiner requested review from a team and theseion July 21, 2026 10:51
@azurit

azurit commented Jul 21, 2026

Copy link
Copy Markdown
Member

Just got another FP from w, rule 932340 (browsing contacts in Horde/IMP webmail):
Matched Data: =W found within REQUEST_HEADERS:Referer: https://example.com/turba/browse.php?show=all&page=W

@theseion
theseion added this pull request to the merge queue Jul 22, 2026
Merged via the queue into coreruleset:main with commit 72b6797 Jul 22, 2026
8 checks passed
@theseion theseion added 🚀 enhancement New feature or request ➕ False Positive and removed 🚀 enhancement New feature or request labels Jul 22, 2026
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.

6 participants