HTTP! Encrypted! Information can be! Stolen through! TCP-windows
by! Mathy Vanhoef & Tom Van Goethem
Agenda Technical background ! Same-Origin Policy ! - - PowerPoint PPT Presentation
H TTP ! E ncrypted ! I nformation can be ! S tolen through ! T CP-windows by ! Mathy Vanhoef & Tom Van Goethem Agenda Technical background ! Same-Origin Policy ! Compression-based attacks ! SSL/TLS & TCP ! Nitty gritty
by! Mathy Vanhoef & Tom Van Goethem
H E I S T
2
H E I S T
3
https://bunnehbank.com
GET /vault
H E I S T
3
https://bunnehbank.com
GET /vault
H E I S T
4
the World Wide Web
https://bunnehbank.com
H E I S T
4
the World Wide Web
https://bunnehbank.com
H E I S T
4
the World Wide Web
https://bunnehbank.com
GET /vault
H E I S T
4
the World Wide Web
https://bunnehbank.com
GET /vault
H E I S T
4
the World Wide Web
https://bunnehbank.com
GET /vault
H E I S T
4
the World Wide Web
https://bunnehbank.com
GET /vault
H E I S T the World Wide Web
https://bunnehbank.com
GET /vault
5
H E I S T
6
the World Wide Web
https://bunnehbank.com
GET /vault
H E I S T
7
H E I S T You requested: /vault _secret=carrots4life
8
/vault
Uncompressed Compressed You requested: /vault vault_secret=carrots4life → 51 bytes → 47 bytes
H E I S T You requested: /vault?secret=c _ arrots4life
9
/vault?secret=a
→ 49 bytes You requested: /vault?secret=a _ carrots4life → 50 bytes
/vault?secret=c
H E I S T You requested: /vault?secret=c _ arrots4life
10
/vault?secret=a
→ 49 bytes You requested: /vault?secret=a _ carrots4life → 50 bytes
/vault?secret=c
49 bytes < 50 bytes → 'c' is a correct guess
H E I S T You requested: /vault?secret=cb _ arrots4life
11
/vault?secret=ca
→ 50 bytes You requested: /vault?secret=ca _ rrots4life → 49 bytes
/vault?secret=cb
H E I S T You requested: /vault?secret=cb _ arrots4life
12
/vault?secret=ca
→ 50 bytes You requested: /vault?secret=ca _ rrots4life → 49 bytes
/vault?secret=cb
49 bytes < 50 bytes → 'ca' is a correct guess
H E I S T
13
H E I S T
14
H E I S T
15
GET /vault S Y N SYN, ACK ACK Client Hello Server Hello P r e
a s t e r S e c r e t
TCP handshake SSL handshake
H E I S T
16
GET /vault
encrypt( GET /vault HTTP/1.1 Cookie: user=mr.sniffles! Host: bunnehbank.com! .... )
1 TCP data packet
H E I S T
17
encrypt( ) = 29 TCP data packets
H E I S T
18
encrypt( ) = 29 TCP data packets
TCP packet 1 TCP packet 2 TCP packet 10 ... initcwnd = 10
H E I S T
18
encrypt( ) = 29 TCP data packets
TCP packet 1 TCP packet 2 TCP packet 10 ... 10 ACKs initcwnd = 10
H E I S T
18
encrypt( ) = 29 TCP data packets
TCP packet 1 TCP packet 2 TCP packet 10 ... 10 ACKs initcwnd = 10 cwnd = 20
H E I S T
18
encrypt( ) = 29 TCP data packets
TCP packet 1 TCP packet 2 TCP packet 10 ... TCP packet 11 ... TCP packet 29 10 ACKs initcwnd = 10 cwnd = 20
H E I S T
exact size of a network response!
as CRIME and BREACH, in the browser
19
H E I S T
receives the first byte of the response
20
fetch('https://bunnehbank.com/vault', {mode: "no-cors", credentials:"include"}) performance.getEntries()[-1].responseEnd
H E I S T
21
H E I S T
22
time
fetch('...')
TCP handshake complete SSL handshake complete GET /vault initial TCP window sent first byte received Promise resolves initial TCP window received responseEnd T1 T2 Fetching small resource: T2 - T1 is very small
H E I S T
23
time
fetch('...')
TCP handshake complete SSL handshake complete GET /vault initial TCP window sent first byte received Promise resolves initial TCP window received ACK sent second TCP window sent second TCP window received responseEnd T1 T2 Fetching large resource: T2 - T1 is round-trip time
H E I S T
24
H E I S T
25
initcwnd second TCP window Resource size: ?? bytes Reflected content: x bytes
H E I S T
26
initcwnd second TCP window Resource size: ?? bytes Reflected content: x/2 bytes
H E I S T
27
initcwnd second TCP window Resource size: ?? bytes Reflected content: x/2+x/4 bytes
H E I S T
28
initcwnd second TCP window Resource size: ?? bytes Reflected content: y bytes After log(n) checks, we find: ! y bytes of reflected content = 1 TCP window! ! y+1 bytes of reflected content = 2 TCP windows → resource size = initcwnd - y bytes
H E I S T
29
H E I S T
30
H E I S T
31
CWND = 10
GET /foo 10 TCP packets 10 ACKs
CWND = 20
GET /vault
= 19 TCP data packets
19 TCP packets 19 ACKs
sent in single TCP window
H E I S T
32
H E I S T
33
H E I S T
in the same response!
server!
in the same resource
34
H E I S T
35
CWND = 10
GET /reflect?x=... GET /vault = 6 TCP packets /reflect?x=... = 3 TCP packets
contains both /reflect and /vault
9 TCP packets 9 ACKs
responseEnd Promise resolves
H E I S T
36
CWND = 10
GET /reflect?x=... 1 TCP packet GET /vault = 6 TCP packets 1 ACK /reflect?x=... = 5 TCP packets
contains both /reflect and part of /vault CWND = 20
10 TCP packets 10 ACKs
responseEnd Promise resolves
H E I S T
38
H E I S T
39
H E I S T
40
H E I S T
the browser, for all authenticated cross-origin resources!
multiple layers!
41
Mathy Vanhoef! @vanhoefm! mathy.vanhoef@cs.kuleuven.be Tom Van Goethem! @tomvangoethem! tom.vangoethem@cs.kuleuven.be