Skip to content
RCE Advisory Intermediate

GHSL-2025-023: Authenticated RCE in binance-trading-bot via command injection

The /restore endpoint passes the uploaded file's name to a shell command without sanitising it, so an authenticated user can inject shell commands. This allows remote code execution on the host with the application's privileges.

Kwstubbs Follow

Originally disclosed on GitHub Security Lab

Authenticated users of binance-trading-bot can achieve Remote Code Execution on the host system due to a command injection vulnerability in the /restore endpoint.

Kwstubbs, on GitHub Security Lab

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 report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The uploaded file's name is concatenated into a shell command string passed to shell.exec, so shell metacharacters in the name are interpreted as commands.

Impact

An authenticated user could execute arbitrary commands on the host with the application's privileges, leading to remote code execution.

What the attacker needed

Valid authentication token; access to the /restore endpoint

The fix

The issue was fixed by using execFile instead of exec so arguments are treated as plain strings, not shell commands.

How it was found

  1. Send a POST request to the /restore endpoint with a valid authentication token.
  2. Include a multipart form field named archive whose filename contains a shell command payload.
  3. The server saves the file and runs the restore script with the file path, executing the injected command.

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 report has not been written yet. The Original tab links to the source.

The application takes the name of a file you upload and puts it directly into a command that the computer runs. If you name the file in a special way, you can make the computer run extra commands of your choosing. 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.

More by Kwstubbs

View all

43 more disclosed reports, best first.

More from GitHub Security Lab

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.