Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
39e5c926
Commit
39e5c926
authored
Mar 28, 2024
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http2_hpack: Enforce http_req_size limit
Refs #3709 Refs #3892 Conflicts: bin/varnishd/http2/cache_http2_hpack.c
parent
b4a5f99d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
3 deletions
+31
-3
cache_http2_hpack.c
bin/varnishd/http2/cache_http2_hpack.c
+6
-1
r03709.vtc
bin/varnishtest/tests/r03709.vtc
+25
-2
No files found.
bin/varnishd/http2/cache_http2_hpack.c
View file @
39e5c926
...
...
@@ -267,7 +267,8 @@ h2h_decode_init(const struct h2_sess *h2)
d
=
h2
->
decode
;
INIT_OBJ
(
d
,
H2H_DECODE_MAGIC
);
VHD_Init
(
d
->
vhd
);
d
->
out_l
=
WS_ReserveAll
(
h2
->
new_req
->
http
->
ws
);
d
->
out_l
=
WS_Reserve
(
h2
->
new_req
->
http
->
ws
,
cache_param
->
http_req_size
);
/*
* Can't do any work without any buffer
* space. Require non-zero size.
...
...
@@ -308,6 +309,10 @@ h2h_decode_fini(const struct h2_sess *h2)
}
else
ret
=
d
->
error
;
d
->
magic
=
0
;
if
(
ret
==
H2SE_REQ_SIZE
)
{
VSLb
(
h2
->
new_req
->
http
->
vsl
,
SLT_LostHeader
,
"Header list too large"
);
}
return
(
ret
);
}
...
...
bin/varnishtest/tests/r03709.vtc
View file @
39e5c926
...
...
@@ -2,17 +2,40 @@ varnishtest "h2 req limits"
varnish v1 -cliok "param.set feature +http2"
varnish v1 -cliok "param.set http_req_hdr_len 40b"
varnish v1 -cliok "param.set http_req_size 512b"
varnish v1 -vcl {
backend be none;
} -start
logexpect l1 -v v1 -g raw -q BogoHeader {
logexpect l1 -v v1 -g raw -q BogoHeader
,LostHeader
{
expect 0 1001 BogoHeader "Header too large: :path"
expect 0 1002 LostHeader "Header list too large"
} -start
client c1 {
stream next {
txreq -url ${string,repeat,4,/123456789}
txreq -url ${string,repeat,4,/123456789} \
-hdr limit http_req_hdr_len
rxrst
expect rst.err == ENHANCE_YOUR_CALM
} -run
stream next {
txreq -url "/http_req_size" \
-hdr hdr1 ${string,repeat,3,/123456789} \
-hdr hdr2 ${string,repeat,3,/123456789} \
-hdr hdr3 ${string,repeat,3,/123456789} \
-hdr hdr4 ${string,repeat,3,/123456789} \
-hdr hdr5 ${string,repeat,3,/123456789} \
-hdr hdr6 ${string,repeat,3,/123456789} \
-hdr hdr7 ${string,repeat,3,/123456789} \
-hdr hdr8 ${string,repeat,3,/123456789} \
-hdr hdr9 ${string,repeat,3,/123456789} \
-hdr hdr10 ${string,repeat,3,/123456789} \
-hdr hdr11 ${string,repeat,3,/123456789} \
-hdr hdr12 ${string,repeat,3,/123456789} \
-hdr hdr13 ${string,repeat,3,/123456789} \
-hdr hdr14 ${string,repeat,3,/123456789}
rxrst
expect rst.err == ENHANCE_YOUR_CALM
} -run
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment