You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2022/08/08 23:19:26 UTC
[trafficserver] branch asf-master-0809-4 created (now 8880f3c93)
This is an automated email from the ASF dual-hosted git repository.
masaori pushed a change to branch asf-master-0809-4
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
at 8880f3c93 Correct error class of HTTP/2 malformed requests
This branch includes the following new commits:
new 467fa7db1 Add content length mismatch check on handling HEADERS frame and CONTINUATION frame
new 8880f3c93 Correct error class of HTTP/2 malformed requests
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[trafficserver] 02/02: Correct error class of HTTP/2 malformed requests
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
masaori pushed a commit to branch asf-master-0809-4
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 8880f3c93887d5b154f951e99c35f92652c3a650
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Wed Apr 27 15:03:31 2022 +0900
Correct error class of HTTP/2 malformed requests
---
proxy/http2/Http2ConnectionState.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index e37025d70..b0e3a1cd9 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -139,7 +139,7 @@ Http2ConnectionState::rcv_data_frame(const Http2Frame &frame)
return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_NONE);
}
if (!stream->payload_length_is_valid()) {
- return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
+ return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_STREAM, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
"recv data bad payload length");
}
@@ -386,7 +386,7 @@ Http2ConnectionState::rcv_headers_frame(const Http2Frame &frame)
// Check Content-Length & payload length when END_STREAM flag is true
if (stream->recv_end_stream && !stream->payload_length_is_valid()) {
- return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
+ return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_STREAM, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
"recv data bad payload length");
}
@@ -950,7 +950,7 @@ Http2ConnectionState::rcv_continuation_frame(const Http2Frame &frame)
// Check Content-Length & payload length when END_STREAM flag is true
if (stream->recv_end_stream && !stream->payload_length_is_valid()) {
- return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
+ return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_STREAM, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
"recv data bad payload length");
}
[trafficserver] 01/02: Add content length mismatch check on handling HEADERS frame and CONTINUATION frame
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
masaori pushed a commit to branch asf-master-0809-4
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 467fa7db16a375f5fb2470884bd11e78f927ed09
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Wed Apr 20 09:34:31 2022 +0900
Add content length mismatch check on handling HEADERS frame and CONTINUATION frame
---
proxy/http2/Http2ConnectionState.cc | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index 4f60d58d1..e37025d70 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -384,6 +384,12 @@ Http2ConnectionState::rcv_headers_frame(const Http2Frame &frame)
}
}
+ // Check Content-Length & payload length when END_STREAM flag is true
+ if (stream->recv_end_stream && !stream->payload_length_is_valid()) {
+ return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
+ "recv data bad payload length");
+ }
+
// Set up the State Machine
if (!empty_request) {
SCOPED_MUTEX_LOCK(stream_lock, stream->mutex, this_ethread());
@@ -942,6 +948,12 @@ Http2ConnectionState::rcv_continuation_frame(const Http2Frame &frame)
}
}
+ // Check Content-Length & payload length when END_STREAM flag is true
+ if (stream->recv_end_stream && !stream->payload_length_is_valid()) {
+ return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR,
+ "recv data bad payload length");
+ }
+
// Set up the State Machine
SCOPED_MUTEX_LOCK(stream_lock, stream->mutex, this_ethread());
stream->mark_milestone(Http2StreamMilestone::START_TXN);