Executive brief
Strapi is an open-source headless CMS platform used by development teams to manage and distribute content. The admin panel allows authorized users to install and uninstall plugins, but the framework fails to properly validate plugin names before executing system commands. An authenticated administrator can exploit this flaw to execute arbitrary code on the server, potentially compromising the entire application, underlying infrastructure, and customer data.
Technical details
The vulnerability is an OS command injection (CWE-78, CWE-20) in the installPlugin and uninstallPlugin handler functions within packages/strapi-admin/controllers/Admin.js. These functions pass user-supplied plugin names directly to the execa() function without proper sanitization or input validation. An attacker with valid admin credentials (JWT token) can inject shell metacharacters (e.g., &&, ||, $()) into the plugin name parameter to execute arbitrary commands on the host system. The uninstallPlugin function contains a partial regex check (/^[A-Za-z0-9_-]+$/) that was incomplete, while installPlugin lacks any validation. The attack is unauthenticated network-accessible via the /admin/plugins/install or /admin/plugins/uninstall endpoints when admin credentials are present. A successful exploit grants the attacker remote code execution with the privileges of the Node.js process. The vulnerability was patched in version 3.0.0-beta.17.8 via pull request #4636 which validates plugin names properly.
Affected products
- Strapi Strapi before 3.0.0-beta.17.8; all versions <= 3.0.0-beta.17.7
Timeline
- 2019-12-01: disclosed: Issue disclosed to Strapi
- 2019-12-01: patched: Strapi released fix via PR #4636
- 2019-12-03: advisory: NPM issued advisory
- 2021-12-10: other: GHSA-49vv-6q7q-w5cf published (later marked duplicate of GHSA-9p2w-rmx4-9mw7)
- 2025-12-29: other: Advisory withdrawn as duplicate
References
- https://github.com/strapi/strapi/pull/4636
- https://bittherapy.net/post/strapi-framework-remote-code-execution
- https://github.com/strapi/strapi
- http://packetstormsecurity.com/files/163940/Strapi-3.0.0-beta.17.7-Remote-Code-Execution.html
- http://packetstormsecurity.com/files/163950/Strapi-CMS-3.0.0-beta.17.4-Remote-Code-Execution.html