Skip to content
RCE Write-up Intermediate

Unauthenticated flag flipping yields remote code execution

A server exposed runtime flag modification over HTTP or RPC without authentication, allowing an attacker to change a flag that specified the path to an external program (such as ps2pdf or sendmail). By pointing that flag to an attacker-controlled script, the attacker could execute arbitrary commands on the server.

rachelbythebay.com

Published on rachelbythebay.com

I've worked for a few places and had friends at many more, and there are a lot of stories which keep coming up. Sometimes you might read one and think "this is about us".

The author, on rachelbythebay.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

Likely the flag management interface allowed unauthenticated writes to configuration values that were later used as executable paths, with no validation or privilege separation.

Impact

An unauthenticated attacker could achieve remote code execution, potentially with root privileges if the server ran as root, and could also enable hidden backdoors like developer mode.

What the attacker needed

Network access to the flag interface; ability to write a file to a chosen path

How it was found

  1. The server is started with a flag pointing to a legitimate helper program, such as ps2pdf.
  2. An attacker sends a well-formatted HTTP or RPC request to change that flag to a path they control.
  3. The attacker places a malicious script at that path.
  4. The server later invokes the program at the modified path, executing the attacker's script.

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 server had a feature that let anyone change its settings over the network without logging in. One of those settings told the server where to find a helper program to run. By changing that setting to point at a file they controlled, an attacker could make the server run their own code.

What is RCE?

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

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.