You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "arturobernalg (via GitHub)" <gi...@apache.org> on 2026/02/23 11:46:52 UTC
[PR] TTP/2: validate pseudo-headers in inbound request trailers [httpcomponents-core]
arturobernalg opened a new pull request, #637:
URL: https://github.com/apache/httpcomponents-core/pull/637
RFC9113 [8.1. ](https://www.rfc-editor.org/rfc/rfc9113.html#section-8.1)[HTTP Message Framing](https://www.rfc-editor.org/rfc/rfc9113.html#name-http-message-framing) Trailers MUST NOT include [pseudo-header fields](https://www.rfc-editor.org/rfc/rfc9113.html#PseudoHeaderFields) ([Section 8.3](https://www.rfc-editor.org/rfc/rfc9113.html#PseudoHeaderFields)). An endpoint that receives pseudo-header fields in trailers MUST treat the request or response as [malformed](https://www.rfc-editor.org/rfc/rfc9113.html#malformed) ([Section 8.1.1](https://www.rfc-editor.org/rfc/rfc9113.html#malformed)).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
Re: [PR] TTP/2: validate pseudo-headers in inbound request trailers [httpcomponents-core]
Posted by "arturobernalg (via GitHub)" <gi...@apache.org>.
arturobernalg merged PR #637:
URL: https://github.com/apache/httpcomponents-core/pull/637
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
Re: [PR] TTP/2: validate pseudo-headers in inbound request trailers [httpcomponents-core]
Posted by "arturobernalg (via GitHub)" <gi...@apache.org>.
arturobernalg commented on code in PR #637:
URL: https://github.com/apache/httpcomponents-core/pull/637#discussion_r2845749799
##########
httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerH2StreamHandler.java:
##########
@@ -265,7 +265,16 @@ public void consumeHeader(final List<Header> headers, final boolean endStream) t
}
break;
case BODY:
- responseState.set(MessageState.COMPLETE);
+ if (!endStream) {
+ throw new H2StreamResetException(H2Error.PROTOCOL_ERROR, "Trailer headers must set END_STREAM");
+ }
+ try {
+ TrailersValidationSupport.verify(headers);
+ } catch (final H2ConnectionException ex) {
+ throw new H2StreamResetException(H2Error.PROTOCOL_ERROR, ex.getMessage());
Review Comment:
@ok2c . Good one. Thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
Re: [PR] TTP/2: validate pseudo-headers in inbound request trailers [httpcomponents-core]
Posted by "ok2c (via GitHub)" <gi...@apache.org>.
ok2c commented on code in PR #637:
URL: https://github.com/apache/httpcomponents-core/pull/637#discussion_r2842820255
##########
httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerH2StreamHandler.java:
##########
@@ -265,7 +265,16 @@ public void consumeHeader(final List<Header> headers, final boolean endStream) t
}
break;
case BODY:
- responseState.set(MessageState.COMPLETE);
+ if (!endStream) {
+ throw new H2StreamResetException(H2Error.PROTOCOL_ERROR, "Trailer headers must set END_STREAM");
+ }
+ try {
+ TrailersValidationSupport.verify(headers);
+ } catch (final H2ConnectionException ex) {
+ throw new H2StreamResetException(H2Error.PROTOCOL_ERROR, ex.getMessage());
Review Comment:
@arturobernalg Please pick up my changes from master and rebase
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org