Skip to content

[http] introduce TRootSniffer::fAllowPostObject flag#22192

Open
linev wants to merge 1 commit intoroot-project:masterfrom
linev:http_post_off
Open

[http] introduce TRootSniffer::fAllowPostObject flag#22192
linev wants to merge 1 commit intoroot-project:masterfrom
linev:http_post_off

Conversation

@linev
Copy link
Copy Markdown
Member

@linev linev commented May 8, 2026

It allows to deserialize post data as ROOT object when processing exe.json request.
While this is sensitive functionality which can leads to arbitrary code loading and injection,
disable this feature by default. Can be enabled back with:

serv->SetAllowPostObject(kTRUE);

@linev linev requested review from dpiparo and jblomer May 8, 2026 13:40
@linev linev self-assigned this May 8, 2026
Comment thread net/http/inc/THttpServer.h Outdated

Bool_t IsAllowPostObject() const;

void SetAllowPostObject(Bool_t allow_post_obj = kFALSE);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove the default value. I think it is confusing that calling SetAllowPostObject() turns off the functionality.

Comment thread net/http/inc/TRootSniffer.h Outdated
Bool_t IsReadOnly() const { return fReadOnly; }

/** Allow to deserialize object in POST requests, default off */
void SetAllowPostObject(Bool_t allow_post_obj = kFALSE) { fAllowPostObject = allow_post_obj; }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here regarding the default value.

Comment thread net/http/inc/THttpServer.h Outdated
Comment on lines +97 to +99
Bool_t IsAllowPostObject() const;

void SetAllowPostObject(Bool_t allow_post_obj = kFALSE);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this functionality is actually only relevant for the sniffer, wouldn't it be enough to add those two methods in TRootSniffer.h?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally user interact with THttpServer instance. Therefore I provide such configuration methods in both classes

} else if ((val != nullptr) && (fCurrentArg != nullptr) && (fCurrentArg->GetPostData() != nullptr)) {
// process several arguments which are specific for post requests
if (strcmp(val, "_post_object_xml_") == 0) {
if (fAllowPostObject && strcmp(val, "_post_object_xml_") == 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if you try to post but fAllowPostObject == false? It would be useful to have a test for this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I check that no I/O performed directly with POST data.
Data will be ignored.

It allows to deserialize post data as ROOT object when processing exe.json request.
While this can create leads to arbitrary code loading and injection, disable this feature by default.
Can be enabled back with:
 ```
serv->SetAllowPostObject(kTRUE);
```
@linev linev force-pushed the http_post_off branch from 5a48113 to 3572f6a Compare May 8, 2026 14:39
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

Test Results

    22 files      22 suites   3d 11h 26m 32s ⏱️
 3 850 tests  3 799 ✅ 0 💤 51 ❌
76 936 runs  76 885 ✅ 0 💤 51 ❌

For more details on these failures, see this check.

Results for commit 3572f6a.

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.

2 participants