Story - Finding the issue
The online IDE's terminal was hidden but could be opened via a command, allowing arbitrary command execution. The attacker could read system files, SSL private keys, and AWS credentials from the container metadata.
Published on jatindhankhar.in
Found a way to escape the sandboxed editor to perform Remote Code Execution which leads to the ability to view AWS credentials, SSL certificate and other stuff.
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 IDE's command palette allowed running tasks that spawn a terminal, bypassing the UI restrictions that hid the terminal.
Impact
The attacker could read sensitive files and AWS credentials, potentially compromising the entire machine and cloud resources.
What the attacker needed
Access to the online IDE
The fix
The instance was taken down and the fix was confirmed by HackerEarth.
How it was found
- Open the IDE and use the global action menu shortcut.
- Run the 'Task: Run selected text' command to open a terminal.
- Use the terminal to read system files and environment variables.
- Use the ECS metadata environment variables to fetch AWS credentials.
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.
An online code editor let users run commands, but the terminal was hidden. By using a built-in command, the attacker opened a terminal and ran any command on the server. This let them read sensitive files and cloud credentials.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.