Skip to content
RCE Disclosed report Intermediate CVE-2022-0764

Command injection in strapi

The Strapi app creation tool passed the template CLI argument to a shell command without sanitisation, allowing arbitrary command execution. An attacker could run commands on the machine of a user who creates a Strapi app with a malicious template value.

strapi/strapi

Originally disclosed on huntr

When creating a strapi app using npxcreate-strapi-app, we can inject arbitrary commands through the template cli argument as per the code in this particular link, this happens due to improper sanitization of user input.

From the GitHub Advisory Database (GHSA-xrjf-phvv-r4vr, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the template argument was interpolated into a shell command without sanitisation, allowing command injection.

What the attacker needed

User runs npx create-strapi-app; attacker controls template argument

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 report has not been written yet. The Original tab links to the source.

When you create a new Strapi project, you can choose a template by typing a name. The tool took that name and ran it as part of a system command without checking it. A malicious template name could therefore make the computer run extra commands chosen by an attacker.

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.