Attacking Secondary Contexts in Web Applications
Attacking Secondary Contexts in Web Applications
Contexts in Web
Applications
Sam Curry
whoami
● Sam Curry
(@samwcyo)
● GET /index.html
○ Tries to load in /webserver/index.html
● GET /folder/index.html
○ Tries to load in /webserver/folder/index.html
● Information disclosure
○ Internal HTTP headers, access token
● What control do
we have over the
second request?
● We can traverse the internal API, overwrite the user ID, then read a victim’s file
● All other API calls are also accessible
● GET /my-services/invoices/..%2finvoices%2fINV08179455/pdf
○ This works (200 with PDF content)
● GET /my-services/invoices/..%2f..%2fmy-services%2finvoices%2fINV08179455/pdf
○ This doesn’t (404 without PDF content)
● Moment of truth...
Identifying application routing - Examples
GET /my-services/edit-payment-method?uid=../../
[email protected]%23vj/paymentmethods/2c92a00871083a4600fa287ce52fe
Identifying application routing - Examples
● Impact of course varies per case, but there are lots of interesting possibilities
Case Study - Authy 2FA bypass
● Authy - 2FA service, installable library
● User -> [Client -> Authy]
Case Study - Authy 2FA bypass
● When reading the response from Authy, the server only checked for…
○ JSON {“success”:true}
○ HTTP 200 OK