Skip to content

[6.36] [http] sanitize URL options before use them#22355

Merged
linev merged 6 commits into
root-project:v6-36-00-patchesfrom
linev:http_sanity_636
May 21, 2026
Merged

[6.36] [http] sanitize URL options before use them#22355
linev merged 6 commits into
root-project:v6-36-00-patchesfrom
linev:http_sanity_636

Conversation

@linev
Copy link
Copy Markdown
Member

@linev linev commented May 20, 2026

Backport of #22186

linev added 6 commits May 20, 2026 15:55
Remove any special symbols
Add escape characters for quote and escape itself
Discard all URL options longer than 1K

Try to avoid manipulation of arguments for method execution
Avoid special characters as draw arguments
Always use DecodeUrlOptionValue method when processing URL arguments
or URL string. Internally method provides escape symbols for quotes and backslash.
If expecting numeric value - remove all symbols
keeping alphanumeric, '.', '+', '-' and ':'
It allows to deserialize post data as ROOT object when processing exe.json request.
While this can leads to arbitrary code loading and injection, disable this feature by default.
Can be enabled back with:
 ```
serv->SetAllowPostObject(kTRUE);
```
While here arbitrary string injected into ProcessLine,
ensure that only numeric argument is not quoted.
All other arguments kinds will be quoted and prevent execution of potentially dangerous code
Verify execution of several supported requests
which can be handled by http server. Testing:
   - root.json
   - root.xml
   - file.root
   - exe.json
   - exe.json with POST data
   - item.json
   - cmd.json
   - multi.json

Also verify basic functionality of
TRootSniffer::DecodeUrlOptionValue method
@linev linev self-assigned this May 20, 2026
@linev linev requested a review from bellenot as a code owner May 20, 2026 13:56
@linev linev merged commit 3d046a9 into root-project:v6-36-00-patches May 21, 2026
17 of 20 checks passed
@linev linev deleted the http_sanity_636 branch May 21, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant