Skip to content
Access control Write-up Intermediate

PoC Exploit for Nginx packaging on Debian-based distros [video]

The Nginx package on Debian-based and Gentoo systems created log files with insecure permissions, allowing a local attacker with www-data access to escalate privileges to root. The video demonstrates this by first exploiting a file upload vulnerability to gain a www-data shell, then using the Nginx flaw to become root.

legalhackers.com

Published on legalhackers.com

The original lives on legalhackers.com

We do not hold its text, 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

Root cause

Likely the Nginx package set insecure permissions on log files, allowing the www-data user to write to files that are later processed with root privileges.

Impact

An attacker with www-data access could escalate to root, gaining full control of the system.

What the attacker needed

Local access as www-data; vulnerable Nginx package

How it was found

  1. Exploit a file upload vulnerability in a web application to upload a reverse shell.
  2. Gain a shell as the www-data user.
  3. Use the Nginx packaging vulnerability to escalate privileges to root.

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.

This is about a flaw in how the Nginx web server software was packaged for some Linux distributions. The package created log files that any user could modify, so an attacker who already had a low-privilege account on the server could change those files to run commands as the all-powerful root user. The video shows an attacker first breaking into a website to get that low-privilege account, then using this flaw to take full control of the server.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.