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
450961a0
Commit
450961a0
authored
Jun 22, 2021
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VSV00007 Test case for H2 smuggling attack
parent
d4c67d2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
0 deletions
+79
-0
f00007.vtc
bin/varnishtest/tests/f00007.vtc
+79
-0
No files found.
bin/varnishtest/tests/f00007.vtc
0 → 100644
View file @
450961a0
varnishtest "H/2 content length smuggling attack"
server s1 {
rxreqhdrs
expect_close
} -start
server s2 {
rxreqhdrs
expect_close
} -start
server s3 {
rxreq
expect_close
} -start
server s4 {
rxreq
expect req.body == "A"
txresp
} -start
varnish v1 -vcl+backend {
import vtc;
sub vcl_backend_fetch {
if (bereq.url == "/1") {
set bereq.backend = s1;
} else if (bereq.url == "/2") {
set bereq.backend = s2;
} else if (bereq.url == "/3") {
set bereq.backend = s3;
} else {
set bereq.backend = s4;
}
}
} -start
varnish v1 -cliok "param.set feature +http2"
varnish v1 -cliok "param.set debug +syncvsl"
client c1 {
stream 1 {
txreq -req POST -url /1 -hdr "content-length" "1" -nostrend
txdata -data "AGET /FAIL HTTP/1.1\r\n\r\n"
rxrst
expect rst.err == PROTOCOL_ERROR
} -run
} -run
client c2 {
stream 1 {
txreq -req POST -url /2 -hdr "content-length" "1" -nostrend
txdata -data "AGET /FAIL HTTP/1.1\r\n\r\n" -nostrend
txdata
rxrst
expect rst.err == PROTOCOL_ERROR
} -run
} -run
client c3 {
stream 1 {
txreq -req POST -url /3 -hdr "content-length" "1" -nostrend
txdata -data "A" -nostrend
txdata -data "GET /FAIL HTTP/1.1\r\n\r\n"
rxrst
expect rst.err == PROTOCOL_ERROR
} -run
} -run
client c4 {
stream 1 {
txreq -req POST -url /4 -hdr "content-length" "1" -nostrend
txdata -data "A" -nostrend
txdata
rxresp
expect resp.status == 200
} -run
} -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