Vulnerabilities in pkg:npm/@apostrophecms/cli
PACKAGECVE-2026-42853 is a MODERATE (CVSS 6.5) command injection vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting @apostrophecms/cli libraries in the npm ecosystem. The issue involves command injection in apos create via unsanitized password input. Remediation is available in the latest vendor maintenance releases.
pkg:npm/@apostrophecms/cli
Vulnerability advisories affecting package pkg:npm/@apostrophecms/cli. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-hcwq-x9fw-8cfq | CVE-2026-42853 | MODERATE | @apostrophecms/cli: Command Injection in apos create via Unsanitized Password Input |
CVE-2026-42853 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2026-42853
To remediate this vulnerability, upgrade all affected @apostrophecms/cli dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @apostrophecms/cli@Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @apostrophecms/cli
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-42853, inspect your project dependencies using npm:
npm ls @apostrophecms/cli
Analyze the terminal output to locate any version of @apostrophecms/cli in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: The npm ls @apostrophecms/cli command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In @apostrophecms/cli, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-42853 Affected @apostrophecms/cli Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@apostrophecms/cli
|
npm |
≤ 3.6.0
|
|
References
Frequently Asked Questions
What is CVE-2026-42853?
Which @apostrophecms/cli versions are affected?
What version fixes CVE-2026-42853?
Is @apostrophecms/cli affected?
What is the CVSS score of CVE-2026-42853?
What CWE is associated with CVE-2026-42853?
How can I check npm dependencies for CVE-2026-42853?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hcwq-x9fw-8cfq",
"modified" : "2026-06-12T22:01:56Z",
"published" : "2026-05-14T16:16:16Z",
"aliases" : [ "CVE-2026-42853" ],
"summary" : "@apostrophecms/cli: Command Injection in apos create via Unsanitized Password Input",
"details" : "Summary\n\nThe @apostrophecms/cli package contains a command injection vulnerability in the apos create command.\nUser-supplied input from the password prompt is embedded directly into a shell command without proper sanitization or escaping.\nThis allows execution of arbitrary commands on the host system.\n\n━━━━━━━━━━━━━━━━━━━━━━\n\nDetails\n\nVulnerable file: lib/commands/create.js\nLocation: Line 186\n\nThe CLI collects a password using an interactive prompt and passes it directly into a shell command.\n\nVulnerable code:\n\nconst response = await prompts({\ntype: 'password',\nname: 'pw',\nmessage: '🔏 Please enter a password:'\n});\n\nexec(echo \"${response.pw}\" | ${createUserCommand});\n\nThe value of response.pw is not validated, sanitized, or escaped before being used in exec().\n\nThis allows shell metacharacters such as ;, &&, and $() to break out of the intended command and execute arbitrary commands.\n\n━━━━━━━━━━━━━━━━━━━━━━\n\nSteps to Reproduce\n\n1) Install the CLI\n npm install -g @apostrophecms/cli\n2) Create a new project\n mkdir testproject && cd testproject\n apos create mysite\n3)When prompted for the admin password, enter\n \"; id > /tmp/apos_rce_proof.txt; echo \"\n4)Verify command execution\n cat /tmp/apos_rce_proof.txt\n\n━━━━━━━━━━━━━━━━━━━━━━\n\nProof of Concept Output\n\nuid=1000(vboxuser) gid=1000(vboxuser) groups=1000(vboxuser),27(sudo),984(docker)\n\nThis confirms arbitrary command execution with the privileges of the user running the CLI.\n\n━━━━━━━━━━━━━━━━━━━━━━\n\nImpact\n\nArbitrary command execution on the developer’s machine\nExecution occurs with the privileges of the user running the CLI\n\nThis can lead to:\n\nFile modification or deletion\nCredential exposure\nSystem compromise depending on user privileges\n\nAn attacker can exploit this by influencing the password input (for example, through social engineering, malicious documentation, or compromised automation scripts).\n\nThe proof-of-concept shows execution under a user belonging to privileged groups such as sudo and docker, which may allow further privilege escalation depending on system configuration.\n\n━━━━━━━━━━━━━━━━━━━━━━\n\nSuggested Fix\n\nAvoid using exec() with user-controlled input.\n\nUse execFile() instead:\n\nconst { execFileSync } = require('child_process');\n\nexecFileSync('node', [appJsPath, userTask, 'admin', 'admin'], {\ninput: response.pw + '\\n'\n});\n\n━━━━━━━━━━━━━━━━━━━━━━\n\nAffected Version\n\nAll current versions of @apostrophecms/cli\n\n━━━━━━━━━━━━━━━━━━━━━━\n\nTested On\n\nUbuntu 22.04\nNode.js v18.19.1\n\n━━━━━━━━━━━━━━━━━━━━━━\n\nCWE\n\nCWE-78 — Improper Neutralization of Special Elements used in an OS Command\n\n━━━━━━━━━━━━━━━━━━━━━━",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@apostrophecms/cli"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "3.6.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/apostrophecms/apostrophe/security/advisories/GHSA-hcwq-x9fw-8cfq"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-42853"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/apostrophecms/apostrophe"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-78" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-14T16:16:16Z",
"nvd_published_at" : "2026-06-12T21:16:21Z"
}
}