Skip to content
Path traversal Write-up Intermediate

Nginx security advisory (CVE-2013-4547)

Nginx did not run some URI checks on the character after an unescaped space in a request URI. An attacker could use a crafted request to bypass access restrictions such as a deny rule, or to make a file with a trailing space be processed as PHP.

mailman.nginx.org

Published on mailman.nginx.org

Ivan Fratric of the Google Security Team discovered a bug in nginx, which might allow an attacker to bypass security restrictions in certain configurations by using a specially crafted request, or might have potential other impact (CVE-2013-4547).

The author, on mailman.nginx.org

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 security restrictions in certain configurations, such as a deny rule, or cause a file with a trailing space to be processed as PHP; the advisory notes it might have other impact too.

What the attacker needed

Nginx 0.8.41 to 1.5.6; a configuration with a deny rule or PHP handler; attacker can send crafted requests

The fix

The problem was fixed in nginx 1.5.7 and 1.4.4, and a temporary workaround is to reject any request whose URI contains a space.

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.

Nginx is a web server that can block or allow requests based on the address path. A space in a web address is normally not allowed, but nginx accepted it for compatibility. Because of that, nginx skipped some safety checks on the next character, so a specially built address could reach a file that should have been blocked.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.