Repository navigation
[#716] Require GET space prefix in pgexporter_http_server_parse - #717
Open
hardikkaurani wants to merge 1 commit into
Open
hardikkaurani wants to merge 1 commit into
hardikkaurani wants to merge 1 commit into
Conversation
Contributor
Author
|
Hi @jesperpedersen and @ecleon26, I opened this PR for #716 to tighten method validation and bounds checking in
Formatted with |
Collaborator
hardikkaurani
force-pushed
the
fix/http-server-get-prefix-bounds
branch
from
December 2, 2026 21:30
2265f18 to
731b379
Compare
Contributor
Author
|
@Pranav-error Rebased onto |
…arse Signed-off-by: Hardik Kaurani <[email protected]>
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.
Closes #716
Summary
pgexporter_http_server_parse()(src/libpgexporter/http_server.c) to requiremsg->length >= 4and a"GET "4-byte prefix instead of"GET"(3 bytes), preventing out-of-bounds pointer formation (msg->data + 4) on 3-byte"GET"payloads and rejecting non-GET methods starting with"GET"(e.g.,"GETX/metrics").req == NULLandconfig == NULLbefore dereferencing them inpgexporter_http_server_parse().test_http_server_parse_get_prefixintest/testcases/test_http.ccovering 3-byte"GET","GETX/metrics", and valid"GET /metrics"requests over a socket pair.Verification
src/libpgexporter/http_server.candtest/testcases/test_http.cwithclang-format(clang-format --dry-run --Werrorpassed).