NGINX may be protecting your applications from traversal attacks without you even knowing
A path traversal vulnerability in an application was blocked by an AWS Application Load Balancer (ALB) that normalises URLs similarly to NGINX. By using multiple slashes, the attacker could bypass the ALB's protection and reach the vulnerable application, allowing file reads outside the intended directory.
medium.com
Published on medium.com
By Danny Robinson and Rotem Bar
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could bypass the ALB's blocking of traversal attempts and read arbitrary files from the server, but only if the backend application itself is vulnerable to path traversal.
What the attacker needed
Backend app vulnerable to path traversal; ALB or NGINX with merge_slashes off
The fix
The behaviour is not considered a vulnerability and is unlikely to change; instead, test applications directly or use a WAF for protection.
How it was found
- Send a request with '../' to the application directly and observe file read outside the intended directory.
- Send the same request through the AWS ALB and receive a 400 Bad Request.
- Modify the request by adding extra slashes and send it through the ALB.
- Observe that the request reaches the vulnerable application and the file is read.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A path traversal bug lets an attacker read files outside the intended folder by using '../' in a URL. Here, a load balancer (a traffic cop) blocked such requests, but adding extra slashes tricked it into letting the request through to the vulnerable app.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.