Path rules and trap paths match the path decoded once too (closes #85)
check / check (push) Waiting to run
check / check (push) Waiting to run
A path rule matched only the path as the client sent it, so /%2eenv got past the default env-file rule while an app that decodes the path serves /.env. A path rule now matches the path as sent or decoded once, as a uri rule already did, and so does a path in SWWAF_TRAP_PATHS: /%77p-login.php matches /wp-login.php. The query is cut off before the path is decoded, and the path is decoded only once, so /%252eenv is not /.env. A ban's notes keep the path as sent. SPEC.md and README.md say so. Model: opus-5-5
This commit was merged in pull request #125.
This commit is contained in:
@@ -825,7 +825,8 @@ a file edited, added or removed there takes effect while it runs.
|
||||
- `id`: a short name of letters, digits, `-` and `_`, unique across all files.
|
||||
It appears in the request log, metrics, alerts and ban notes.
|
||||
- `target`: what the regex is matched against.
|
||||
- `path`: the URL path as received, before any decoding.
|
||||
- `path`: the URL path without the query, both as received and once
|
||||
percent-decoded, so an encoded probe cannot slip past.
|
||||
- `query`: the raw query string.
|
||||
- `uri`: path and query together, both as received and once percent-decoded,
|
||||
so an encoded probe cannot slip past.
|
||||
|
||||
Reference in New Issue
Block a user