10000 fix: prevent invalid commands matches on 5 characters or less (932220 PL-2, 932230 PL-1, 932232 PL-3, 932235 PL-1, 932236 PL-2, 932237 PL-3, 932238 PL-3, 932239 PL-2, 932250 PL-1, 932260 PL-1) by EsadCetiner · Pull Request #3735 · coreruleset/coreruleset · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: prevent invalid commands matches on 5 characters or less (932220 PL-2, 932230 PL-1, 932232 PL-3, 932235 PL-1, 932236 PL-2, 932237 PL-3, 932238 PL-3, 932239 PL-2, 932250 PL-1, 932260 PL-1) #3735

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 85 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
f9be489
fix: prevent invalid commands matches on 5 characters or less (932230…
EsadCetiner Jun 15, 2024
b870dc9
fix: copy paste error
EsadCetiner Jun 15, 2024
1e56e28
fix: invalid output in tests
EsadCetiner Jun 15, 2024
f97a09c
test: enable tests to detect new attacks
EsadCetiner Jun 16, 2024
cdd86d7
Merge branch 'coreruleset:main' into fix-invalid-command-matches
EsadCetiner Jun 18, 2024
b583f22
test: enable tests to detect new attacks
EsadCetiner Jun 18, 2024
ac55e54
fix: correct description for 932250-4
EsadCetiner Jun 18, 2024
259cb1f
Merge branch 'main' into fix-invalid-command-matches
EsadCetiner Jun 22, 2024
8e001e5
perf: use word boundry to prevent invalid matches
EsadCetiner Jun 22, 2024
b893999
test: add test for id command
EsadCetiner Jun 22, 2024
2355eb7
fix: invalid output for tests
EsadCetiner Jun 22, 2024
7101a8f
Merge branch 'main' into fix-invalid-command-matches
EsadCetiner Jul 2, 2024
2d54859
fix: add missing line break
EsadCetiner Jul 2, 2024
40f9b4b
fix: invalid test format
EsadCetiner Jul 3, 2024
1dbcd8f
chore: update toolchain
EsadCetiner Jul 3, 2024
a07ffa4
test: enable tests for newly detected attacks
EsadCetiner Jul 3, 2024
98a8cf2
fix: don't use word boundry to prevent invalid matches
EsadCetiner Jul 9, 2024
fa948a0
Merge branch 'main' into fix-invalid-command-matches
EsadCetiner Jul 10, 2024
1d0f38e
chore: regenerate rules regex
EsadCetiner Jul 10, 2024
6a65620
Merge branch 'main' into fix-invalid-command-matches
EsadCetiner Jul 31, 2024
fc79c86
fix: add chained rule to prevent common false positives
EsadCetiner Jul 31, 2024
07a72fc
fix: setvar ordering
EsadCetiner Jul 31, 2024
d564524
fix: use lf instead of crlf
EsadCetiner Jul 31, 2024
d509025
fix: setvar ordering
EsadCetiner Jul 31, 2024
98b2c3d
fix: typos
EsadCetiner Aug 2, 2024
bb8fcfa
docs: clarify test descriptions
EsadCetiner Aug 2, 2024
2a614d7
docs: improve descriptions
EsadCetiner Aug 2, 2024
cd636ee
fix: brace expansion detection
EsadCetiner Aug 2, 2024
8f05ee5
style: improve test description formatting
EsadCetiner Aug 3, 2024
a95b81f
style: improve test description formatting
EsadCetiner Aug 3, 2024
9cfef8e
Merge branch 'main' into fix-invalid-command-matches
EsadCetiner Aug 4, 2024
3064180
Merge branch 'coreruleset:main' into fix-invalid-command-matches
EsadCetiner Aug 8, 2024
d9e69e4
Update regex-assembly/932237.ra
EsadCetiner Aug 11, 2024
d712d3c
chore: update unix-shell.data
theseion Aug 11, 2024
721efe5
chore: update list generation scripts and update lists
theseion Aug 11, 2024
f50ec30
fix: use correct match in list update script
theseion Aug 11, 2024
3cc3e7a
chore: update unix-shell-fps-pl1
theseion Aug 11, 2024
c711003
chore: update regular expressions
theseion Aug 11, 2024
f91054a
chore: revert unnecessary chain rule
theseion Aug 11, 2024
8f86a75
chore: fix failing tests
theseion Aug 11, 2024
73d57c9
Merge branch 'main' into fix-invalid-command-matches
EsadCetiner Sep 13, 2024
bc487a4
Merge branch 'main' into fix-invalid-command-matches
EsadCetiner Sep 30, 2024
51d75ac
fix: linting error
EsadCetiner Sep 30, 2024
e96b6ce
fix: linting error
EsadCetiner Sep 30, 2024
d156d78
fix: whitespace
EsadCetiner Sep 30, 2024
1679e61
Merge branch 'main' into fix-invalid-command-matches
EsadCetiner Oct 1, 2024
9db01df
Merge branch 'main' into fix-invalid-command-matches
EsadCetiner Nov 1, 2024
a3082b8
chore: move php / cron FPs to curated list
theseion Nov 8, 2024
5fe7c58
Merge branch 'main' into fix-invalid-command-matches
theseion Nov 8, 2024
8c89575
chore: do not exclude php / cron by commenting them in FP file
theseion Nov 8, 2024
32295f9
chore: update anti-evasion pattern in all places
theseion Nov 8, 2024
0b7da0b
Merge branch 'main' into fix-invalid-command-matches
theseion Nov 22, 2024
c77a668
chore: only exclude exact match for specific commands
theseion Nov 22, 2024
01e8b6a
chore: give quantitative tests write permissions to PR
theseion Nov 22, 2024
33f75a2
chore: fix `yes` and `date`
theseion Nov 24, 2024
99df75e
Merge branch 'main' into fix-invalid-command-matches
EsadCetiner Nov 25, 2024
00ef9f3
up
EsadCetiner Nov 25, 2024
43586fe
fix: tests
EsadCetiner Nov 25, 2024
0fc5d0c
fix: lint
EsadCetiner Nov 25, 2024
370d414
update comments
EsadCetiner Nov 25, 2024
2fd7e81
fix: typo
EsadCetiner Nov 25, 2024
e3e7e3d
Merge branch 'main' into fix-invalid-command-matches
EsadCetiner Dec 1, 2024
69f41d9
up
EsadCetiner Dec 1, 2024
a1d6326
fix: sync pl-2 exclusions with pl-1
EsadCetiner Dec 3, 2024
9f06a2b
fix: some commands not being excluded correctly
EsadCetiner Dec 3, 2024
f6cda1d
chore: update regex
EsadCetiner Dec 3, 2024
66f674a
fix: exclude pwd from pl-1
EsadCetiner Dec 3, 2024
0ab62ee
fix: fp with `hash` and `lastcommonreqid`
EsadCetiner Dec 3, 2024
e787cca
fix: pashto afghanistan user-agent fp at pl-3
EsadCetiner Dec 5, 2024
10df976
fix: copy-paste leftover
EsadCetiner Dec 5, 2024
5e255ad
fix: exclude `install` at pl-2
EsadCetiner Dec 5, 2024
14ddd7b
Merge branch 'coreruleset:main' into fix-invalid-command-matches
EsadCetiner Dec 22, 2024
8873f48
fix: exclude `ed` at pl-2
EsadCetiner Dec 22, 2024
b1ab68d
chore: use correct toolchain version
EsadCetiner Dec 22, 2024
5cb7d30
typos
EsadCetiner Jan 4, 2025
d1adff4
Merge branch 'main' into fix-invalid-command-matches
EsadCetiner Jan 4, 2025
29d8296
fix: change definition of `~` and exclude exact match `java`
EsadCetiner Jan 12, 2025
0597589
Merge branch 'main' into fix-invalid-command-matches
EsadCetiner Jan 12, 2025
c148712
fix: test numbering
EsadCetiner Jan 12, 2025
9bf8e99
chore: update unix-shell.data
EsadCetiner Jan 12, 2025
7038308
fix: typos
EsadCetiner Jan 12, 2025
20ecdd8
chore: update anti_evasion_no_space_suffixes
theseion Jan 15, 2025
8466d83
fix: regression with unix evasion suffix no space
EsadCetiner Jan 16, 2025
e20192d
chore: update regex
EsadCetiner Jan 16, 2025
8cffb1a
Merge branch 'main' into fix-invalid-command-matches
EsadCetiner Feb 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion regex-assembly/932235.ra
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
##! These patterns are approximations of the patterns used by the cmdline
##! processor for `@` and `~`.
##! These patterns are used across multiple files, change with care.
##!> include-except unix-shell-4andup unix-shell-fps-pl1-curated -- @ [\s<>&|)] ~ \S
##!> include-except unix-shell-4andup unix-shell-fps-pl1-curated -- @ (?:[\s<>&|),]|$) ~ \S{1,10}\b
4 changes: 2 additions & 2 deletions regex-assembly/932236.ra
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
##! These patterns are approximations of the patterns used by the cmdline
##! processor for `@` and `~`.
##! These patterns are used across multiple files, change with care.
##!> include-except unix-shell-upto3 unix-shell-fps-pl2 unix-shell-fps-pl2-start-of-string -- @ [\s<>&|)] ~ \S
##!> include-except unix-shell-4andup unix-shell-fps-pl2 unix-shell-fps-pl2-start-of-string -- @ [\s<>&|)] ~ \S
##!> include-except unix-shell-upto3 unix-shell-fps-pl2 unix-shell-fps-pl2-start-of-string -- @ (?:[\s<>&|),]|$) ~ \S{1,10}\b
##!> include-except unix-shell-4andup unix-shell-fps-pl2 unix-shell-fps-pl2-start-of-string -- @ (?:[\s<>&|),]|$) ~ \S{1,10}\b
6 changes: 3 additions & 3 deletions regex-assembly/932237.ra
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
##! These patterns are approximations of the patterns used by the cmdline
##! processor for `@` and `~`.
##! These patterns are used across multiple files, change with care.
##!> include-except unix-shell-upto3 unix-shell-fps-useragents -- @ [\s<>&|)] ~ \S
##!> include-except unix-shell-4andup unix-shell-fps-useragents -- @ [\s<>&|)] ~ \S
##!> include-except unix-shell-pl3 unix-shell-fps-useragents -- @ [\s<>&|)] ~ \S
##!> include-except unix-shell-upto3 unix-shell-fps-useragents -- @ (?:[\s<>&|),]|$) ~ \S{1,10}\b
##!> include-except unix-shell-4andup unix-shell-fps-useragents -- @ (?:[\s<>&|),]|$) ~ \S{1,10}\b
##!> include-except unix-shell-pl3 unix-shell-fps-useragents -- @ (?:[\s<>&|),]|$) ~ \S{1,10}\b
4 changes: 2 additions & 2 deletions regex-assembly/932239.ra
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
##! These patterns are approximations of the patterns used by the cmdline
##! processor for `@` and `~`.
##! These patterns are used across multiple files, change with care.
##!> include-except unix-shell-upto3 unix-shell-fps-pl2 unix-shell-fps-pl2-start-of-string unix-shell-fps-useragents -- @ [\s<>&|)] ~ \S
##!> include-except unix-shell-4andup unix-shell-fps-pl2 unix-shell-fps-pl2-start-of-string unix-shell-fps-useragents -- @ [\s<>&|)] ~ \S
##!> include-except unix-shell-upto3 unix-shell-fps-pl2 unix-shell-fps-pl2-start-of-string unix-shell-fps-useragents -- @ (?:[\s<>&|),]|$) ~ \S{1,10}\b
##!> include-except unix-shell-4andup unix-shell-fps-pl2 unix-shell-fps-pl2-start-of-string unix-shell-fps-useragents -- @ (?:[\s<>&|),]|$) ~ \S{1,10}\b
2 changes: 1 addition & 1 deletion regex-assembly/932250.ra
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
##! This pattern is an approximation of the pattern used by the cmdline
##! processor for `@`.
##! This pattern is used across multiple files, change with care.
[\s<>&|)]
[\s<>&|),]|$
##!<
##!<
2 changes: 1 addition & 1 deletion regex-assembly/932260.ra
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
##! These patterns are approximations of the patterns used by the cmdline
##! processor for `@` and `~`.
##! These patterns are used across multiple files, change with care.
##!> include-except unix-shell-4andup unix-shell-fps-pl1 -- @ [\s<>&|)] ~ \S
##!> include-except unix-shell-4andup unix-shell-fps-pl1 -- @ (?:[\s<>&|),]|$) ~ \S{1,10}\b
##!<
33 changes: 31 additions & 2 deletions regex-assembly/exclude/unix-shell-fps-pl1.ra
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
##! while read -r oword; do
##! found=0
##! while read -r eword; do
##! if grep -qE "^${eword}[@~]?" <<<"${oword}"; then
##! if grep -qE "^${eword}[@~]?$" <<<"${oword}"; then
##! result="${result}${eword}${NL}"
##! result="${result}${eword}@${NL}"
##! result="${result}${eword}~${NL}"
Expand Down Expand Up @@ -64,6 +64,10 @@
##! EOF
##! echo "${result}" | sort | uniq >> regex-assembly/exclude/unix-shell-fps-pl1.ra

##! Note: As part of the effort to reduce FPs mid-term (https://github.com/coreruleset/coreruleset/pull/3735)
##! we've decided to exclude some commands for which only the exact match is an issue
##! (mostly for 933236).

GET
GET@
GET~
Expand Down Expand Up @@ -162,6 +166,9 @@ check_memory
check_raid
check_ssl_cert
check_statusfile
chef
chef@
chef~
chflags
chmod
choom
Expand Down Expand Up @@ -197,7 +204,10 @@ cpulimit
crash
crash@
crash~
cron
cron@
crontab
cron~
csplit
csvtool
cupsfilter
Expand Down Expand Up @@ -549,6 +559,11 @@ perms~
pf
pf@
pg
pg@
pg~
php
php@
php~
pic
pic@
pico@
Expand Down Expand Up @@ -579,6 +594,10 @@ puppet
puppet@
puppet~
pushd
##! excluded as part of PR #3735
pwd
pwd@
pwd~
python
python@
python~
Expand Down Expand Up @@ -726,8 +745,12 @@ tic@
tic~
time
time@
timedatectl
time~
timedatectl
##! excluded as part of PR #3735
timeout
timeout@
timeout~
tmux
top
top@
Expand All @@ -740,6 +763,10 @@ tshark
ul
ul@
ulimit@
##! excluded as part of PR #3735
uname
uname@
uname~
uncompress
uncompress@
uncompress~
Expand Down Expand Up @@ -789,6 +816,8 @@ whiptail~
who
who@
whois
whois@
whois~
who~
wireshark
wish
Expand Down
119 changes: 119 additions & 0 deletions regex-assembly/exclude/unix-shell-fps-pl2.ra
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,152 @@
##! `awk@` to `awk~`, this list would not have to be updated.
##! See also unix-shell-fps-pl1.ra.

##! Note: As part of the effort to reduce FPs mid-term (https://github.com/coreruleset/coreruleset/pull/3735)
##! we've decided to exclude some commands for which only the exact match is an issure
##! (mostly for 933236).

aptitude
aptitude@
aptitude~
##! excluded as part of PR #3735
cron
cron@
cron~
date
date@
date~
##! excluded as part of PR #3735
dir
dir@
dir~
dnf
dnf@
dnf~
##! excluded as part of PR #3735
ed
ed@
ed~
##! excluded as part of PR #3735
file
file@
file~
##! excluded as part of PR #3735
GET
GET@
GET~
##! excluded as part of PR #3735
hash
hash@
hash~
##! excluded as part of PR #3735
HEAD
HEAD@
HEAD~
##! excluded as part of PR #3735
id
id@
id~
##! excluded as part of PR #3735
install
install@
install~
##! excluded as part of PR #3735
java
java@
java~
##! excluded as part of PR #3735
mail
mail@
mail~
more
more@
more~
##! excluded as part of PR #3735
null
null@
null~
pacman
pacman@
pacman~
ps
ps@
ps~
##! excluded as part of PR #3735
pg
pg@
pg~
##! excluded as part of PR #3735
php
php@
php~
##! excluded as part of PR #3735
POST
POST@
POST~
##! excluded as part of PR #3735
rename
rename@
rename~
##! excluded as part of PR #3735
repeat
repeat@
repeat~
##! excluded as part of PR #3735
screen
screen@
screen~
##! excluded as part of PR #3735
sort
sort@
sort~
##! excluded as part of PR #3735
ss
ss@
ss~
##! excluded as part of PR #3735
source
source@
source~
##! excluded as part of PR #3735
task
task@
task~
time
time@
time~
##! excluded as part of PR #3735
timeout
timeout@
timeout~
##! excluded as part of PR #3735
uname
uname@
uname~
up2date
up2date@
up2date~
vi
vi@
vi~
##! excluded as part of PR #3735
wall
wall@
wall~
##! excluded as part of PR #3735
view
view@
view~
who
who@
who~
##! excluded as part of PR #3735
whois
whois@
whois~
w
w@
w~
##! excluded as part of PR #3735
yes
yes@
yes~
Loading
0