{"id":"CVE-2026-42853","aliases":["CVE-2026-42853","GHSA-hcwq-x9fw-8cfq"],"related":[],"kind":"vulnerability","state":"published","title":"@apostrophecms/cli: Command Injection in apos create via Unsanitized Password Input","summary":"ApostropheCMS is an open-source Node.js content management system. Versions of the @apostrophecms/cli package up to and including 3.6.0 contain a command injection vulnerability in the apos create command. User-supplied input from the password prompt is embedded directly into a shell command without proper sanitization or escaping. This allows execution of arbitrary commands on the host system. As of time of publication, no known patched versions are available.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"ApostropheCMS is an open-source Node.js content management system. Versions of the @apostrophecms/cli package up to and including 3.6.0 contain a command injection vulnerability in the apos create command. User-supplied input from the password prompt is embedded directly into a shell command without proper sanitization or escaping. This allows execution of arbitrary commands on the host system. As of time of publication, no known patched versions are available.","source":"cvelist"},{"lang":"en","text":"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━━━━━━━━━━━━━━━━━━━━━━","format":"markdown","source":"ghsa"},{"lang":"es","text":"ApostropheCMS es un sistema de gestión de contenido de código abierto basado en Node.js. Las versiones del paquete @apostrophecms/cli hasta la 3.6.0 inclusive contienen una vulnerabilidad de inyección de comandos en el comando ’apos create’. La entrada proporcionada por el usuario desde la solicitud de contraseña se incrusta directamente en un comando de shell sin una sanitización o escape adecuados. Esto permite la ejecución de comandos arbitrarios en el sistema anfitrión. En el momento de la publicación, no hay versiones parcheadas conocidas disponibles.","source":"nvd"}],"published":"2026-05-14T16:16:16.000Z","modified":"2026-10-26T11:10:00.157Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:H","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:H","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:H","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-78"],"affected":[{"ranges":[{"version":"<= 3.6.0","status":"affected"}],"vendor":"apostrophecms","product":"@apostrophecms/cli","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"3.6.0"}],"ecosystem":"npm","package":"@apostrophecms/cli","purl":"pkg:npm/%40apostrophecms/cli","source":"ghsa"}],"references":[{"url":"https://github.com/apostrophecms/apostrophe/security/advisories/GHSA-hcwq-x9fw-8cfq","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42853","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/apostrophecms/apostrophe","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-06-13T03:34:07.787Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-42853","url":"https://www.cve.org/CVERecord?id=CVE-2026-42853","licence":"CVE Terms of Use","modified":"2026-06-13T03:34:34.865Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hcwq-x9fw-8cfq","url":"https://github.com/advisories/GHSA-hcwq-x9fw-8cfq","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:47.116Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-42853","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42853","licence":"Public domain","modified":"2026-10-26T11:10:00.157Z"}],"updatedAt":"2026-11-25T22:59:24.570Z","epss":{"score":0.00536,"percentile":0.46642,"date":"2026-12-01T12:00:22.000Z"}}