Strapi Framework Vulnerable to Remote Code Execution (CVE-2019-19609)
The Strapi admin plugin install and uninstall handlers passed unsanitised user input to a shell command, allowing an authenticated attacker with a valid JWT to execute arbitrary commands on the server. This could lead to full remote code execution.
bittherapy.net
Published on bittherapy.net
Recently I came across a cool “headless” CMS called Strapi which makes creating dynamic sites painless. After poking around its code for a bit, I noticed a bit of potentially dangerous code in the plugin installPlugin and uninstallPlugin handler functions for the admin panel…
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
Impact
An authenticated attacker could execute arbitrary commands on the server, leading to full compromise.
What the attacker needed
Valid JWT with plugin install permission; Strapi version 3.0.0-beta.17.7 or earlier
The fix
The issue was fixed by Strapi within 20 minutes of disclosure.
How it was found
- Obtain a valid JWT with permission to install plugins.
- Send a POST request to the plugin install endpoint with a malicious plugin name containing shell commands.
- The server executes the injected commands, creating a reverse shell.
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.
Strapi is a content management system. Its admin panel had a feature to install plugins, but it didn't check the plugin name properly. An attacker who could log in as an admin could trick the server into running their own commands, taking over the machine.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.