A Vulnerability That Allowed Me To Do NOTHING
The platform's AI code generation feature allowed users to request code that executed arbitrary system commands, and the execution environment ran as root with the Docker socket mounted. An attacker could achieve remote code execution and escape the container to control the host.
medium.com
Published on medium.com
I am Aditya Shende (aka Kong) from India. A bug bounty hunter, biker and cybersecurity researcher.
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
Likely the platform treated AI-generated code as trusted and executed it without restrictions in a container running as root with the Docker socket mounted and production credentials present.
Impact
An attacker could execute arbitrary commands as root, read sensitive files, access production credentials, and potentially escape the container to control the host, though the author stopped before full exploitation.
What the attacker needed
No authentication required; publicly accessible code editor page; ability to type English sentences
The fix
The platform should treat AI output as untrusted, run code in a sandbox without root privileges, remove the Docker socket, and isolate production credentials.
How it was found
- Open the code editor page in a browser.
- Ensure the language dropdown is set to Python 3.
- Locate the AI PROMPT section and its text area.
- Type a prompt asking for a Python script to execute a system command.
- Click the Generate button to produce code.
- Click the Execute button and observe the command output.
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 report describes a website that let students write and run code. It also had an AI helper that could write code for you. The problem was that the AI would write dangerous code if you asked it to, and the website ran that code with the highest level of permission, called root. That meant someone could read private files or even take over the whole server.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.