CVE-2022-0764: Command injection in strapi

strapi Updated 02 Oct 2025

Summary

27/02/2022
Yes i
Moderate
6.1

CVE-2022-0764: Command injection in strapi. Affects strapi versions < 4.1.0. Fixed in 4.1.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Strapi is an open-source headless CMS (Content Management System) that enables developers to build powerful APIs quickly. It provides a flexible and customizable admin panel for managing content. The vulnerability in question allows for command injection when creating a Strapi app using the npx create-strapi-app command. This vulnerability arises due to improper sanitization of user input in the template CLI argument.

Vulnerability Detail

The command injection vulnerability in Strapi allows an attacker to execute arbitrary commands during the creation of a Strapi app. By injecting malicious commands through the template CLI argument, an attacker can potentially gain unauthorized access, escalate privileges, or perform other malicious activities on the affected system. This vulnerability poses a moderate risk and has a CVSS score of 6.1.

How To Fix

Latest published version: 3.6.11 as of 22 Oct 2026

npm install strapi@3.6.11

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.1.0

This is the first release that contains the fix.

npm install strapi@4.1.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can manually sanitize the template CLI argument by ensuring that only valid and expected values are provided. This can be done by validating and sanitizing user input before passing it to the npx create-strapi-app command. Here is an example of how to sanitize the template CLI argument in Node.js:

const { exec } = require('child_process');

function sanitizeTemplate(template) {
  // Validate and sanitize the template value
  const sanitizedTemplate = template.replace(/[^a-zA-Z0-9-]/g, '');
  return sanitizedTemplate;
}

const template = sanitizeTemplate(userInput);
exec(`npx create-strapi-app --template ${template}`, (error, stdout, stderr) => {
  // Handle the command execution result
});

Conclusion

In conclusion, the command injection vulnerability in Strapi allows for the execution of arbitrary commands during the creation of a Strapi app. It is crucial to update the Strapi package to version 4.1.0 or later to mitigate this vulnerability. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for strapi →

Share this vulnerability

FAQ

Strapi is an open-source headless CMS (Content Management System) that allows developers to build powerful APIs quickly. It provides a flexible and customizable admin panel for managing content.

The command injection vulnerability in Strapi occurs when creating a Strapi app using the npx create-strapi-app command. Improper sanitization of user input in the template CLI argument allows for the injection of arbitrary commands.

This vulnerability can allow an attacker to execute arbitrary commands during the creation of a Strapi app. They may gain unauthorized access, escalate privileges, or perform other malicious activities on the affected system.

The severity of this vulnerability is considered moderate, with a CVSS score of 6.1.

To fix this vulnerability, update the Strapi package to version 4.1.0 or later. Run the command npm install strapi@4.1.0 to update your Strapi installation.

Related vulnerabilities

Recent vulnerabilities recorded for strapi.

How To Fix

Latest published version: 3.6.11 as of 22 Oct 2026

npm install strapi@3.6.11

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.1.0

This is the first release that contains the fix.

npm install strapi@4.1.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback