Skip to content
RCE Write-up Intermediate

How a Single Copied Function Gave Me Pre-Auth RCE in an LLM DevOp

A code-validation endpoint in Bisheng executed user-submitted Python function definitions without authentication, allowing anyone on the network to run arbitrary code on the server. An attacker could gain root inside the backend container and access stored credentials for object storage and the database.

Anthony Cihan Follow

Published on medium.com

There is a particular kind of vulnerability that feels less like a discovery and more like a moment of recognition. You are reading source code, and a pattern goes by that you have seen before — somewhere it caused real damage — and here it is again, unbothered, in a different project, waiting.

Anthony Cihan, on medium.com

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 validation routine compiled and executed each function definition from user input, and the endpoint lacked the authentication dependency that every sibling route enforced.

Impact

An unauthenticated attacker could execute arbitrary code as root inside the backend container and reach object-storage admin credentials and the database connection string, leading to total compromise of the platform and its data.

What the attacker needed

Network access to the Bisheng instance; no authentication required

The fix

The vulnerable code was fixed in current Bisheng, and the author recommended requiring authentication on the endpoint and removing the exec() call in favour of static validation.

How it was found

  1. Send a syntactically valid, inert function definition to the validation endpoint without any session or authorization header and observe the normal validation response.
  2. Submit a function definition whose default argument writes a benign marker to a path inside the container, then read it back out-of-band to prove execution.
  3. Submit a function definition whose default argument makes a controlled callback to a listener, proving outbound egress and that execution occurred inside the backend container.
  4. Read the process tree to confirm the injected work appears as a child of the application's worker process.

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 platform had a feature that checked whether submitted Python code was valid. Instead of just reading the code, it actually ran part of it. Because the feature had no login check, anyone who could reach the server could make it run their code.

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 Anthony Cihan

View all

2 more disclosed reports, best first.

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.