This repository has been archived by the owner on May 14, 2020. It is now read-only.
932200: PL1 RCE bypass uninitialized variable (DRAFT) #1602
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a draft
Referring to #1513 I think we've 2 different kinds of RCE bypass in PL1 (at least with bash/dash like interpreters):
We already got a rule at PL3 that handles globbing patterns bypass attempts (930120) but it isn't suitable for PL1 because it's likely prone to many false positive. Assuming that the first part of the original payloads twitted by the user (
{ 1 };
) should be removed (otherwise, both doesn't represent a valid syntax) I think we can start with these two:;cat$u+/etc$u/passwd
;cd+/etc;/bin/c*t+passwd
Maybe, when these two techniques are used together, it would be really hard to intercept them at PL1. I mean something like:
www.google.com;cd+/et*;/bi*$u/ca*+passwd
I'm testing it against the following script:
If you want to try my PoC you can easily use this https://github.com/theMiddleBlue/OWASP-CRS-PoC:
git clone https://github.com/theMiddleBlue/OWASP-CRS-PoC.git cd OWASP-CRS-PoC/bash-rce-bypass bash start.sh -f https://github.com/theMiddleBlue/owasp-modsecurity-crs -b pl1-rce-bypass
run exploit:
check audit logs: