Skip to content

Pr3957: Fix S3CrtClient to use origin-form request-target - #3970

Open
sbaluja wants to merge 5 commits into
mainfrom
pr3957
Open

sbaluja wants to merge 5 commits into
mainfrom
pr3957

Conversation

@sbaluja

@sbaluja sbaluja commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available:
#3956
Description of changes:

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@sbaluja
sbaluja force-pushed the pr3957 branch 3 times, most recently from e31f631 to 968477e Compare November 3, 2026 16:25
hippi345 and others added 5 commits November 3, 2026 11:26
HttpRequest::ToCrtHttpRequest() was constructing an absolute-form
request-target (e.g., "PUT http://host/path HTTP/1.1") for every
request. This violates RFC 9112 §3.2.1, which requires origin-form
(path + query only) when a client connects directly to an origin server.

aws-c-http already handles proxy rewriting via
aws_http_rewrite_uri_for_proxy_request, converting to absolute-form
only when necessary. By passing origin-form here, we prevent
security tools like CrowdSec's http-open-proxy scenario from
flagging legitimate S3-compatible storage requests as proxy abuse.

Fixes #3956
- Remove .changelog file (upstream has no such directory)
- Move ToCrtHttpRequestOriginForm test outside DISABLE_DNS_REQUIRED_TESTS
  guard as it requires no network access
Use GetURLEncodedPath() plus the query string. That path always
starts with '/', so the empty-path fallback was unnecessary.

Move the ToCrtHttpRequest cases into http/HttpRequestTest.cpp and
give each one its own test, including root-plus-query, a trailing
slash, reserved characters, and a preserved leading slash.
Put the cases in the repo clang-format style and leave
HttpClientTest.cpp unchanged from main.

This branch has not been deployed

No deployments
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.

3 participants