Skip to content

feat(932390): add shell fork bomb detection rule at PL2#4563

Merged
fzipi merged 6 commits into
mainfrom
932390-fork-bomb-detection
Mar 25, 2026
Merged

feat(932390): add shell fork bomb detection rule at PL2#4563
fzipi merged 6 commits into
mainfrom
932390-fork-bomb-detection

Conversation

@fzipi
Copy link
Copy Markdown
Member

@fzipi fzipi commented Mar 23, 2026

what

  • add new rule 932390 (PL2) to detect shell fork bomb patterns
  • create regex-assembly file 932390.ra for the detection pattern
  • add 14 regression tests (10 positive, 4 negative)

why

  • fork bombs like :(){ :|:& };: were not detected by existing RCE rules
  • existing 932 rules rely on known command word lists, but fork bombs work with any function name
  • this rule detects the structural pattern name() { ... | ... & ... } regardless of the function name used

refs

  • addresses 9Y4-260316 - Fork Bomb Bypass at PL3, reported by @HackingRepo

Detect shell fork bomb patterns where a function is defined with a
body that recursively pipes to itself and backgrounds the process,
causing exponential process creation (e.g. `:(){ :|:& };:`).

The rule matches the structural pattern `name() { ... | ... & ... }`
where the function name can include word characters and bash builtins
like `:` and `.`.

Addresses 9Y4-260316 - Fork Bomb Bypass at PL3, reported by @HackingRepo.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 23, 2026

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

@fzipi fzipi requested a review from a team March 23, 2026 13:17
@HackingRepo
Copy link
Copy Markdown
Contributor

thank's, I appreciate it

@HackingRepo
Copy link
Copy Markdown
Contributor

HackingRepo commented Mar 23, 2026

But that f(){ f & f; }; f will evade the rule and not be detected and also a valid fork bomb @fzipi.

@HackingRepo
Copy link
Copy Markdown
Contributor

also f(){ f() | f(); }; f and f(){ f() & f(); }; f bypass the rule

@fzipi
Copy link
Copy Markdown
Member Author

fzipi commented Mar 23, 2026

Updated regex and added tests.

@fzipi fzipi added the release:new-detection In this PR we introduce a new detection label Mar 23, 2026
Comment thread regex-assembly/932390.ra Outdated
Comment thread regex-assembly/932390.ra Outdated
Comment thread rules/REQUEST-932-APPLICATION-ATTACK-RCE.conf Outdated
Comment thread rules/REQUEST-932-APPLICATION-ATTACK-RCE.conf Outdated
Comment thread rules/REQUEST-932-APPLICATION-ATTACK-RCE.conf Outdated
Comment thread regex-assembly/932390.ra Outdated
fzipi and others added 2 commits March 24, 2026 09:25
Co-authored-by: Max Leske <250711+theseion@users.noreply.github.com>
Comment thread rules/REQUEST-932-APPLICATION-ATTACK-RCE.conf Outdated
Comment thread regex-assembly/932390.ra Outdated
Co-authored-by: Max Leske <250711+theseion@users.noreply.github.com>
@fzipi fzipi requested a review from theseion March 25, 2026 19:51
@HackingRepo
Copy link
Copy Markdown
Contributor

HackingRepo commented Mar 25, 2026

Ok, let's merge @fzipi.

@fzipi fzipi added this pull request to the merge queue Mar 25, 2026
Merged via the queue into main with commit 89c9d90 Mar 25, 2026
8 checks passed
@fzipi fzipi deleted the 932390-fork-bomb-detection branch March 25, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:new-detection In this PR we introduce a new detection

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants