Skip to content

Latest commit

 

History

History
35 lines (19 loc) · 1.6 KB

LESSON_02.md

File metadata and controls

35 lines (19 loc) · 1.6 KB

LESSON #2: Broken Authentication

(2.1) Open API

The DVSA uses a designated API call to process billing requests. However, the API is open to any call without authentication.

This allows malicious users to brute-force credit card numbers using the payment processing API:

alt payment

alt bf

(2.2) Broken Authentication Scheme

The DVSA uses AWS Cognito for authentication. The authorization header is a JSON Web Token (JWT) which holds all the user's information. However, the application does not verify the signature of the JWT and it is therefore possible to send requests and impersonate other users.

For example, sending the {"action": "orders"} request returns an user's orders:

alt orders

If we decode the Authorization header, we get our own auth token: alt token

But, if we take the middle part, decode it with base, replace the username with the victim's username and re-encode it, we get: alt faketoken

Sending the request now, will give us the orders of the victim:

alt victim-orders

alt stolen-orders


ToC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10