GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Port 4.1: Validate header values on DefaultHeaders.copy(), bulk add, entry setValue and ReadOnlyHttpHeaders (#17841) by normanmaurer · Pull Request #17854 · netty/netty Conversation
Member
Motivation: DefaultHttpHeaders validates header values by default to protect against
Modification:
Result: Header value validation can no longer be bypassed through copy(), Co-authored-by: Chris Vest [email protected]
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…entry setValue and ReadOnlyHttpHeaders (#17841) Motivation: DefaultHttpHeaders validates header values by default to protect against HTTP response splitting (CWE-113). Several code paths bypassed this validation, so a default-constructed instance could end up carrying CR/LF in a header value, which the HTTP/1 encoder writes to the wire as is: - DefaultHeaders.copy() used a constructor that installs ValueValidator.NO_VALIDATION, so copies (for example from FullHttpMessage.copy()/replace()) did not validate values. - The addImpl fast path copies entries without validating them when the hashing strategy and name validator are identical, but did not compare the value validator. Values from a non-validating (or tainted) headers instance could be merged into a validating one. - HeaderEntry.setValue(...), reachable via the iterator, only checked for null. - ReadOnlyHttpHeaders validated header names but not header values when validation was requested. Modification: - Pass the value validator to the copy created by DefaultHeaders.copy(). - Only use the addImpl fast path when the value validator is the same instance as well. - Let each HeaderEntry remember the value validator of its headers (set in add0, so it also covers HeaderEntry subclasses such as the HTTP/2 and HTTP/3 ones) and validate in setValue(...). - Validate header values in ReadOnlyHttpHeaders when validation is enabled. - Add tests to DefaultHttpHeadersTest and ReadOnlyHttpHeadersTest. Result: Header value validation can no longer be bypassed through copy(), add/set/setAll of other headers, Map.Entry.setValue(...) or ReadOnlyHttpHeaders. --------- Co-authored-by: Chris Vest <[email protected]>
This comment has been minimized.Uh oh!
There was an error while loading. Please reload this page.
lltopk
pushed a commit
to lltopk/netty
that referenced
this pull request
…entry setValue and ReadOnlyHttpHeaders (netty#17841) (netty#17854) Motivation: DefaultHttpHeaders validates header values by default to protect against HTTP response splitting (CWE-113). Several code paths bypassed this validation, so a default-constructed instance could end up carrying CR/LF in a header value, which the HTTP/1 encoder writes to the wire as is: - DefaultHeaders.copy() used a constructor that installs ValueValidator.NO_VALIDATION, so copies (for example from FullHttpMessage.copy()/replace()) did not validate values. - The addImpl fast path copies entries without validating them when the hashing strategy and name validator are identical, but did not compare the value validator. Values from a non-validating (or tainted) headers instance could be merged into a validating one. - HeaderEntry.setValue(...), reachable via the iterator, only checked for null. - ReadOnlyHttpHeaders validated header names but not header values when validation was requested. Modification: - Pass the value validator to the copy created by DefaultHeaders.copy(). - Only use the addImpl fast path when the value validator is the same instance as well. - Let each HeaderEntry remember the value validator of its headers (set in add0, so it also covers HeaderEntry subclasses such as the HTTP/2 and HTTP/3 ones) and validate in setValue(...). - Validate header values in ReadOnlyHttpHeaders when validation is enabled. - Add tests to DefaultHttpHeadersTest and ReadOnlyHttpHeadersTest. Result: Header value validation can no longer be bypassed through copy(), add/set/setAll of other headers, Map.Entry.setValue(...) or ReadOnlyHttpHeaders. --------- Co-authored-by: Chris Vest <[email protected]> --------- Co-authored-by: Chris Vest <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |