Detected RCE but… you must have logged in before: My story of C
The Nginx Proxy Manager application built shell commands by concatenating user-controlled domain names, allowing an authenticated attacker to inject commands. This could lead to remote code execution as root on the host.
Ever encountered those scary-sounding vulnerabilities that seem like a hacker’s dream… but with a tiny condition attached? Yeah, I’m talking about ones that need you to log in first.
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
Root cause
The application concatenated user-supplied domain names directly into shell commands without sanitisation or escaping.
What the attacker needed
Valid login credentials; access to the domain names field
The fix
The vulnerability should be fixed by avoiding string concatenation for command execution and properly sanitising user input.
How it was found
- Set up the application using the provided Docker file and default credentials.
- Download the source code and review the backend files, focusing on certificate.js.
- Identify that the certificate.domain_names variable is user-controlled and concatenated into a command.
- Inject a command using special characters in the domain name field.
- Observe command execution in the Docker logs, confirming root privileges.
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.
The application took a domain name you provide and pasted it directly into a command it runs on the server. By including special characters, an attacker can make the server run their own commands instead. This is called command injection.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.