Skip to content
RCE Write-up Intermediate

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.

Jatin Dhankhar Follow

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.

Jatin Dhankhar, on jatindhankhar.in

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

  1. Open the IDE and use the global action menu shortcut.
  2. Run the 'Task: Run selected text' command to open a terminal.
  3. Use the terminal to read system files and environment variables.
  4. 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.

More from HackerEarth

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.