fix(sandbox): prevent overread request smuggling in L7 REST parser#342
Closed
drew wants to merge 1 commit intoNVIDIA:mainfrom
Closed
fix(sandbox): prevent overread request smuggling in L7 REST parser#342drew wants to merge 1 commit intoNVIDIA:mainfrom
drew wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
|
Thank you for your submission! We ask that you sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by adding a comment below using this text: I have read the DCO document and I hereby sign the DCO. You can retrigger this bot by commenting recheck in this Pull Request. Posted by the DCO Assistant Lite bot. |
Collaborator
|
Closing in favor of a clean re-implementation. The underlying vulnerability is valid and will be tracked via a dedicated issue. |
This was referenced Mar 16, 2026
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.
Motivation
raw_headerthat included bytes read past the header terminator (\r\n\r\n), and the relay path forwarded those overflow bytes upstream before additional L7 parsing, enabling request smuggling/pipelining to bypass per-request policy checks.Description
parse_http_requestto read one byte at a time (read_u8) and stop exactly when the bufferends_with(b"\r\n\r\n"), ensuringraw_headercontains only the current request header block.raw_header.ends_withand retain the existingparse_body_lengthframing logic.parse_http_request_does_not_overread_next_requestthat writes two requests in one write and verifies they are parsed as two separate requests with no overflow included in the firstraw_header.Testing
parse_http_request_does_not_overread_next_request(asynctokio::test) to verify the parser does not consume bytes belonging to a subsequent pipelined request; the test was added tocrates/openshell-sandbox/src/l7/rest.rs.mise run pre-commitin the environment, but it could not complete due to remote tooling/version resolution failures in this sandbox.cargo testfor the crate but could not run becausecargois not available in the execution environment, so the new test was not executed here.Codex Task