Skip to content
RCE Write-up Intermediate

Acme.sh runs arbitrary commands from a remote server

The HiCA certificate authority returned a malicious ACME challenge token containing shell commands, which acme.sh executed on the client machine. An attacker controlling the CA could run arbitrary commands on any system using acme.sh to obtain a certificate from HiCA.

github.com

Published on github.com

acme.sh runs arbitrary commands from a remote server#4659

The author, on github.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 acme.sh did not properly sanitise or validate the challenge token before using it in shell commands, allowing command injection.

Impact

An attacker controlling the CA could execute arbitrary commands on the client machine, potentially leading to full system compromise.

What the attacker needed

Acme.sh client; certificate issuance from HiCA

The fix

The issue was closed as completed, but the text does not describe the fix.

How it was found

  1. The user runs acme.sh to obtain a certificate from HiCA.
  2. HiCA returns a challenge token containing shell commands.
  3. acme.sh writes the token to a file path that includes the commands.
  4. acme.sh executes the commands, which download and run a script from HiCA.

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.

When you get a certificate from a certificate authority (CA), your client software talks to the CA's server. The server sends back a 'challenge' that your client must solve to prove you own the domain. In this case, the CA sent a challenge that contained hidden shell commands, and the acme.sh client ran them without checking. This means the CA could run any command on your computer.

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.