Repository navigation
Conversation
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 aws#3956
- Remove .changelog file (upstream has no such directory) - Move ToCrtHttpRequestOriginForm test outside DISABLE_DNS_REQUIRED_TESTS guard as it requires no network access
hippi345
marked this pull request as ready for review
October 16, 2026 19:01
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue #, if available:
Fixes #3956
Description of changes:
This PR fixes
S3CrtClientto send origin-form request-targets (e.g.,PUT /bucket/key HTTP/1.1) instead of absolute-form (e.g.,PUT http://host/bucket/key HTTP/1.1) when connecting directly to origin servers.Problem:
HttpRequest::ToCrtHttpRequest()was constructing absolute-form request-targets for all requests by prepending the scheme, authority, and port to the path. This violates RFC 9112 §3.2.1, which requires origin-form (path + query only) for direct connections to origin servers. While S3 and most S3-compatible servers accept absolute-form, security tools like CrowdSec'shttp-open-proxyscenario treat it as open-proxy probing, causing IP bans after a single failed request.Solution:
Modified
ToCrtHttpRequest()insrc/aws-cpp-sdk-core/source/http/HttpRequest.cppto set only the path and query string, removing the scheme, authority, and port components.Proxy behavior is preserved:
The CRT HTTP layer (
aws-c-http) handles proxy rewriting viaaws_http_rewrite_uri_for_proxy_request(file:crt/aws-crt-cpp/crt/aws-c-http/source/proxy_connection.c, lines 931-1000). This function:s_proxy_http_request_transformat line 1010)This is per RFC 7230 §5.3.2, which requires absolute-form only for requests through forward proxies. Direct connections use origin-form.
Signing is not affected:
The CRT signers (SigV4/SigV4a via
ToCrtHttpRequest) compute signatures over the canonical URI, which should be just the path component. The signing configuration includes the region and service name separately (seeAWSAuthV4Signer.cpplines 95-98), and the Host header is already set correctly. All 1088 core tests pass with this change.Testing:
Added unit test
HttpRequestConversionTest.ToCrtHttpRequestOriginFormthat verifies:Test is placed outside
DISABLE_DNS_REQUIRED_TESTSguard as it requires no network access.Test output before fix (showing absolute-form bug):
Test output after fix (origin-form, all tests pass):
Full test suite: 1088 tests passed.
Check all that applies:
Check which platforms you have built SDK on to verify the correctness of this PR.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Generated with AI assistance and reviewed by hippi345.