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 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
- The user runs acme.sh to obtain a certificate from HiCA.
- HiCA returns a challenge token containing shell commands.
- acme.sh writes the token to a file path that includes the commands.
- 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.