CWE-94
Allowed-with-ReviewImproper Control of Generation of Code ('Code Injection')
Abstraction: Base · Status: Draft
The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
9229 vulnerabilities reference this CWE, most recent first.
GHSA-2P4F-Q7G6-G44M
Vulnerability from github – Published: 2022-05-24 19:02 – Updated: 2022-05-24 19:02A code injection vulnerability has been discovered in the Upgrade function of QibosoftX1 v1.0. An attacker is able execute arbitrary PHP code via exploitation of client_upgrade_edition.php and Upgrade.php.
{
"affected": [],
"aliases": [
"CVE-2021-27811"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-05-21T18:15:00Z",
"severity": "HIGH"
},
"details": "A code injection vulnerability has been discovered in the Upgrade function of QibosoftX1 v1.0. An attacker is able execute arbitrary PHP code via exploitation of client_upgrade_edition.php and Upgrade.php.",
"id": "GHSA-2p4f-q7g6-g44m",
"modified": "2022-05-24T19:02:56Z",
"published": "2022-05-24T19:02:56Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-27811"
},
{
"type": "WEB",
"url": "https://github.com/whiskey-jj/w2s2x2222.github.io/issues/2"
},
{
"type": "WEB",
"url": "https://www.cnvd.org.cn/flaw/show/2297879"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-2P55-MR3X-RQXJ
Vulnerability from github – Published: 2022-05-01 23:58 – Updated: 2022-05-01 23:58src/configure.in in Vim 5.0 through 7.1, when used for a build with Python support, does not ensure that the Makefile-conf temporary file has the intended ownership and permissions, which allows local users to execute arbitrary code by modifying this file during a time window, or by creating it ahead of time with permissions that prevent its modification by configure.
{
"affected": [],
"aliases": [
"CVE-2008-3294"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-07-24T18:41:00Z",
"severity": "LOW"
},
"details": "src/configure.in in Vim 5.0 through 7.1, when used for a build with Python support, does not ensure that the Makefile-conf temporary file has the intended ownership and permissions, which allows local users to execute arbitrary code by modifying this file during a time window, or by creating it ahead of time with permissions that prevent its modification by configure.",
"id": "GHSA-2p55-mr3x-rqxj",
"modified": "2022-05-01T23:58:44Z",
"published": "2022-05-01T23:58:44Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-3294"
},
{
"type": "WEB",
"url": "http://lists.apple.com/archives/security-announce/2008/Oct/msg00001.html"
},
{
"type": "WEB",
"url": "http://seclists.org/fulldisclosure/2008/Jul/0312.html"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/31159"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/32222"
},
{
"type": "WEB",
"url": "http://support.apple.com/kb/HT3216"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/494532/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/494535/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/494736/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/31681"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2008/2146/references"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2008/2780"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-2P6P-9RC9-62J9
Vulnerability from github – Published: 2024-12-18 19:47 – Updated: 2025-10-22 19:26Impact
You are affected if your php.ini configuration has register_argc_argv enabled.
Patches
Update to 3.9.14, 4.13.2, or 5.5.2.
Workarounds
If you can't upgrade yet, and register_argc_argv is enabled, you can disable it to mitigate the issue.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "craftcms/cms"
},
"ranges": [
{
"events": [
{
"introduced": "5.0.0-RC1"
},
{
"fixed": "5.5.2"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "craftcms/cms"
},
"ranges": [
{
"events": [
{
"introduced": "4.0.0-RC1"
},
{
"fixed": "4.13.2"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "craftcms/cms"
},
"ranges": [
{
"events": [
{
"introduced": "3.0.0"
},
{
"fixed": "3.9.14"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-56145"
],
"database_specific": {
"cwe_ids": [
"CWE-78",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2024-12-18T19:47:26Z",
"nvd_published_at": "2024-12-18T21:15:08Z",
"severity": "CRITICAL"
},
"details": "### Impact\nYou are affected if your php.ini configuration has `register_argc_argv` enabled.\n\n### Patches\nUpdate to 3.9.14, 4.13.2, or 5.5.2.\n\n### Workarounds\nIf you can\u0027t upgrade yet, and `register_argc_argv` is enabled, you can disable it to mitigate the issue.",
"id": "GHSA-2p6p-9rc9-62j9",
"modified": "2025-10-22T19:26:43Z",
"published": "2024-12-18T19:47:26Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/craftcms/cms/security/advisories/GHSA-2p6p-9rc9-62j9"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-56145"
},
{
"type": "WEB",
"url": "https://github.com/craftcms/cms/commit/82e893fb794d30563da296bca31379c0df0079b3"
},
{
"type": "WEB",
"url": "https://github.com/Chocapikk/CVE-2024-56145"
},
{
"type": "PACKAGE",
"url": "https://github.com/craftcms/cms"
},
{
"type": "WEB",
"url": "https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2024-56145"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:H",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:A",
"type": "CVSS_V4"
}
],
"summary": "Craft CMS has potential RCE when PHP `register_argc_argv` config setting is enabled"
}
GHSA-2P7J-4WF3-79HX
Vulnerability from github – Published: 2021-12-16 00:02 – Updated: 2022-07-13 00:01Microsoft Defender for IoT Remote Code Execution Vulnerability This CVE ID is unique from CVE-2021-41365, CVE-2021-42310, CVE-2021-42311, CVE-2021-42313, CVE-2021-42315, CVE-2021-43882, CVE-2021-43889.
{
"affected": [],
"aliases": [
"CVE-2021-42314"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-12-15T15:15:00Z",
"severity": "HIGH"
},
"details": "Microsoft Defender for IoT Remote Code Execution Vulnerability This CVE ID is unique from CVE-2021-41365, CVE-2021-42310, CVE-2021-42311, CVE-2021-42313, CVE-2021-42315, CVE-2021-43882, CVE-2021-43889.",
"id": "GHSA-2p7j-4wf3-79hx",
"modified": "2022-07-13T00:01:42Z",
"published": "2021-12-16T00:02:04Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-42314"
},
{
"type": "WEB",
"url": "https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2021-42314"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-2PC9-4J83-QJMR
Vulnerability from github – Published: 2026-01-21 16:12 – Updated: 2026-07-21 12:32Summary
vLLM loads Hugging Face auto_map dynamic modules during model resolution without gating on trust_remote_code, allowing attacker-controlled Python code in a model repo/path to execute at server startup.
Impact
An attacker who can influence the model repo/path (local directory or remote Hugging Face repo) can achieve arbitrary code execution on the vLLM host during model load.
This happens before any request handling and does not require API access.
Affected Versions
All versions where vllm/model_executor/models/registry.py resolves auto_map entries with try_get_class_from_dynamic_module without checking trust_remote_code (at least current main).
Details
During model resolution, vLLM unconditionally iterates auto_map entries from the model config and calls try_get_class_from_dynamic_module, which delegates to Transformers’ get_class_from_dynamic_module and executes the module code.
This occurs even when trust_remote_code is false, allowing a malicious model repo to embed code in a referenced module and have it executed during initialization.
Relevant code
vllm/model_executor/models/registry.py:856— auto_map resolutionvllm/transformers_utils/dynamic_module.py:13— delegates toget_class_from_dynamic_module, which executes code
Fixes
- https://github.com/vllm-project/vllm/pull/32194
Credits
Reported by bugbunny.ai
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "vllm"
},
"ranges": [
{
"events": [
{
"introduced": "0.10.1"
},
{
"fixed": "0.14.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-22807"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-01-21T16:12:54Z",
"nvd_published_at": "2026-01-21T22:15:49Z",
"severity": "HIGH"
},
"details": "# Summary\n\nvLLM loads Hugging Face `auto_map` dynamic modules during model resolution **without gating on `trust_remote_code`**, allowing attacker-controlled Python code in a model repo/path to execute at server startup.\n\n---\n\n# Impact\n\nAn attacker who can influence the model repo/path (local directory or remote Hugging Face repo) can achieve **arbitrary code execution** on the vLLM host during model load. \nThis happens **before any request handling** and does **not require API access**.\n\n---\n\n# Affected Versions\n\nAll versions where `vllm/model_executor/models/registry.py` resolves `auto_map` entries with `try_get_class_from_dynamic_module` **without checking `trust_remote_code`** (at least current `main`).\n\n---\n\n# Details\n\nDuring model resolution, vLLM unconditionally iterates `auto_map` entries from the model config and calls `try_get_class_from_dynamic_module`, which delegates to Transformers\u2019 `get_class_from_dynamic_module` and **executes the module code**.\n\nThis occurs even when `trust_remote_code` is `false`, allowing a malicious model repo to embed code in a referenced module and have it executed during initialization.\n\n### Relevant code\n\n- `vllm/model_executor/models/registry.py:856` \u2014 auto_map resolution \n- `vllm/transformers_utils/dynamic_module.py:13` \u2014 delegates to `get_class_from_dynamic_module`, which executes code\n\n---\n\n# Fixes\n\n* https://github.com/vllm-project/vllm/pull/32194\n\n# Credits\n\nReported by **bugbunny.ai**",
"id": "GHSA-2pc9-4j83-qjmr",
"modified": "2026-07-21T12:32:15Z",
"published": "2026-01-21T16:12:54Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/vllm-project/vllm/security/advisories/GHSA-2pc9-4j83-qjmr"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-22807"
},
{
"type": "WEB",
"url": "https://github.com/vllm-project/vllm/pull/32194"
},
{
"type": "WEB",
"url": "https://github.com/vllm-project/vllm/commit/78d13ea9de4b1ce5e4d8a5af9738fea71fb024e5"
},
{
"type": "WEB",
"url": "https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-22807.json"
},
{
"type": "WEB",
"url": "https://pypi.org/project/vllm"
},
{
"type": "WEB",
"url": "https://github.com/vllm-project/vllm/releases/tag/v0.14.0"
},
{
"type": "PACKAGE",
"url": "https://github.com/vllm-project/vllm"
},
{
"type": "WEB",
"url": "https://github.com/pypa/advisory-database/tree/main/vulns/vllm/PYSEC-2026-2010.yaml"
},
{
"type": "ADVISORY",
"url": "https://github.com/advisories/GHSA-2pc9-4j83-qjmr"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2431865"
},
{
"type": "WEB",
"url": "https://access.redhat.com/security/cve/CVE-2026-22807"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:5119"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:42644"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:3782"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:3713"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:3462"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:3461"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:30089"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:30088"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:30087"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:10184"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "vLLM affected by RCE via auto_map dynamic module loading during model initialization"
}
GHSA-2PF4-W9V8-C8G6
Vulnerability from github – Published: 2023-03-09 18:30 – Updated: 2023-03-15 18:30An XSL template vulnerability in ENOVIA Live Collaboration V6R2013xE allows Remote Code Execution.
{
"affected": [],
"aliases": [
"CVE-2023-1287"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-03-09T17:15:00Z",
"severity": "CRITICAL"
},
"details": "An XSL template vulnerability in ENOVIA Live Collaboration V6R2013xE allows Remote Code Execution.",
"id": "GHSA-2pf4-w9v8-c8g6",
"modified": "2023-03-15T18:30:26Z",
"published": "2023-03-09T18:30:30Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-1287"
},
{
"type": "WEB",
"url": "https://www.3ds.com/vulnerability/advisories"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-2PFH-Q76X-GWVM
Vulnerability from github – Published: 2021-09-23 23:16 – Updated: 2024-09-06 17:47A flaw was found in Ansible, where a user's controller is vulnerable to template injection. This issue can occur through facts used in the template if the user is trying to put templates in multi-line YAML strings and the facts being handled do not routinely include special template characters. This flaw allows attackers to perform command injection, which discloses sensitive information. The highest threat from this vulnerability is to confidentiality and integrity.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "ansible"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.9.23rc1"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "PyPI",
"name": "ansible"
},
"ranges": [
{
"events": [
{
"introduced": "2.10.0a1"
},
{
"fixed": "2.10.11rc1"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "PyPI",
"name": "ansible"
},
"ranges": [
{
"events": [
{
"introduced": "2.11.0a1"
},
{
"fixed": "2.11.2rc1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-3583"
],
"database_specific": {
"cwe_ids": [
"CWE-20",
"CWE-77",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2021-09-23T17:11:22Z",
"nvd_published_at": "2021-09-22T12:15:00Z",
"severity": "HIGH"
},
"details": "A flaw was found in Ansible, where a user\u0027s controller is vulnerable to template injection. This issue can occur through facts used in the template if the user is trying to put templates in multi-line YAML strings and the facts being handled do not routinely include special template characters. This flaw allows attackers to perform command injection, which discloses sensitive information. The highest threat from this vulnerability is to confidentiality and integrity.",
"id": "GHSA-2pfh-q76x-gwvm",
"modified": "2024-09-06T17:47:39Z",
"published": "2021-09-23T23:16:38Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-3583"
},
{
"type": "WEB",
"url": "https://github.com/ansible/ansible/pull/74960"
},
{
"type": "WEB",
"url": "https://github.com/ansible/ansible/commit/03aff644cc1c00e1f7551195c68fbd0d13a39e6e"
},
{
"type": "WEB",
"url": "https://github.com/ansible/ansible/commit/8aa850e3573e48c9a2f12aef84e8a3a6f5ba4847"
},
{
"type": "WEB",
"url": "https://github.com/ansible/ansible/commit/8b17e5b9229ffaecfe10a4881bc3f87dd2c184e1"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=1968412"
},
{
"type": "ADVISORY",
"url": "https://github.com/advisories/GHSA-2pfh-q76x-gwvm"
},
{
"type": "PACKAGE",
"url": "https://github.com/ansible/ansible"
},
{
"type": "WEB",
"url": "https://github.com/pypa/advisory-database/tree/main/vulns/ansible/PYSEC-2021-358.yaml"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2023/12/msg00018.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Improper Input Validation and Command Injection in Ansible"
}
GHSA-2PGV-8585-494W
Vulnerability from github – Published: 2025-07-22 18:30 – Updated: 2025-07-22 18:30Remote Code Execution in letta.server.rest_api.routers.v1.tools.run_tool_from_source in letta-ai Letta 0.7.12 allows remote attackers to execute arbitrary Python code and system commands via crafted payloads to the /v1/tools/run endpoint, bypassing intended sandbox restrictions.
{
"affected": [],
"aliases": [
"CVE-2025-51482"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-07-22T17:15:33Z",
"severity": "HIGH"
},
"details": "Remote Code Execution in letta.server.rest_api.routers.v1.tools.run_tool_from_source in letta-ai Letta 0.7.12 allows remote attackers to execute arbitrary Python code and system commands via crafted payloads to the /v1/tools/run endpoint, bypassing intended sandbox restrictions.",
"id": "GHSA-2pgv-8585-494w",
"modified": "2025-07-22T18:30:42Z",
"published": "2025-07-22T18:30:42Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-51482"
},
{
"type": "WEB",
"url": "https://github.com/letta-ai/letta/pull/2630"
},
{
"type": "WEB",
"url": "https://github.com/letta-ai/letta"
},
{
"type": "WEB",
"url": "https://www.gecko.security/blog/cve-2025-51482"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-2PHV-J68V-WWQX
Vulnerability from github – Published: 2026-01-07 18:51 – Updated: 2026-01-08 20:07Summary
A command injection vulnerability exists in pnpm when using environment variable substitution in .npmrc configuration files with tokenHelper settings. An attacker who can control environment variables during pnpm operations could achieve remote code execution (RCE) in build environments.
Affected Components
- Package: pnpm
- Versions: All versions using
@pnpm/config.env-replaceandloadTokenfunctionality - File:
pnpm/network/auth-header/src/getAuthHeadersFromConfig.ts-loadToken()function - File:
pnpm/config/config/src/readLocalConfig.ts-.npmrcenvironment variable substitution
Technical Details
Vulnerability Chain
- Environment Variable Substitution
.npmrcsupports${VAR}syntax-
Substitution occurs in
readLocalConfig() -
loadToken Execution
- Uses
spawnSync(helperPath, { shell: true }) -
Only validates absolute path existence
-
Attack Flow
.npmrc: registry.npmjs.org/:tokenHelper=${HELPER_PATH}
↓
envReplace() → /tmp/evil-helper.sh
↓
loadToken() → spawnSync(..., { shell: true })
↓
RCE achieved
Code Evidence
pnpm/config/config/src/readLocalConfig.ts:17-18
key = envReplace(key, process.env)
ini[key] = parseField(types, envReplace(val, process.env), key)
pnpm/network/auth-header/src/getAuthHeadersFromConfig.ts:60-71
export function loadToken(helperPath: string, settingName: string): string {
if (!path.isAbsolute(helperPath) || !fs.existsSync(helperPath)) {
throw new PnpmError('BAD_TOKEN_HELPER_PATH', ...)
}
const spawnResult = spawnSync(helperPath, { shell: true })
// ...
}
Proof of Concept
Prerequisites
- Private npm registry access
- Control over environment variables
- Ability to place scripts in filesystem
PoC Steps
# 1. Create malicious helper script
cat > /tmp/evil-helper.sh << 'SCRIPT'
#!/bin/bash
echo "RCE SUCCESS!" > /tmp/rce-log.txt
echo "TOKEN_12345"
SCRIPT
chmod +x /tmp/evil-helper.sh
# 2. Create .npmrc with environment variable
cat > .npmrc << 'EOF'
registry=https://registry.npmjs.org/
registry.npmjs.org/:tokenHelper=${HELPER_PATH}
EOF
# 3. Set environment variable (attacker controlled)
export HELPER_PATH=/tmp/evil-helper.sh
# 4. Trigger pnpm install
pnpm install # RCE occurs during auth
# 5. Verify attack
cat /tmp/rce-log.txt
PoC Results
==> Attack successful
==> File created: /tmp/rce-log.txt
==> Arbitrary code execution confirmed
Impact
Severity
- CVSS Score: 7.6 (High)
- CVSS Vector: cvss:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H
Affected Environments
High Risk: - CI/CD pipelines (GitHub Actions, GitLab CI) - Docker build environments - Kubernetes deployments - Private registry users
Low Risk: - Public registry only - Production runtime (no pnpm execution) - Static sites
Attack Scenarios
Scenario 1: CI/CD Supply Chain
Repository → Build Trigger → pnpm install → RCE → Production Deploy
Scenario 2: Docker Build
FROM node:20
ARG HELPER_PATH=/tmp/evil
COPY .npmrc .
RUN pnpm install # RCE
Scenario 3: Kubernetes
Secret Control → Env Variable → .npmrc Substitution → RCE
Mitigation
Temporary Workarounds
Disable tokenHelper:
# .npmrc
# registry.npmjs.org/:tokenHelper=${HELPER_PATH}
Use direct tokens:
//registry.npmjs.org/:_authToken=YOUR_TOKEN
Audit environment variables: - Review CI/CD env vars - Restrict .npmrc changes - Monitor build logs
Recommended Fixes
- Remove
shell: truefrom loadToken - Implement helper path allowlist
- Validate substituted paths
- Consider sandboxing
Disclosure
- Discovery: 2025-11-02
- PoC: 2025-11-02
- Report: [Pending disclosure decision]
References
- Repository: https://github.com/pnpm/pnpm
- Affected:
@pnpm/config.env-replace@^3.0.2 - Similar: CVE-2024-53866, CVE-2023-37478
Credit
Reported by: Jiyong Yang Contact: sy2n0@naver.com
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "pnpm"
},
"ranges": [
{
"events": [
{
"introduced": "6.25.0"
},
{
"fixed": "10.27.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-69262"
],
"database_specific": {
"cwe_ids": [
"CWE-78",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-01-07T18:51:07Z",
"nvd_published_at": "2026-01-07T23:15:50Z",
"severity": "HIGH"
},
"details": "## Summary\n\nA command injection vulnerability exists in pnpm when using environment variable substitution in `.npmrc` configuration files with `tokenHelper` settings. An attacker who can control environment variables during pnpm operations could achieve remote code execution (RCE) in build environments.\n\n## Affected Components\n\n- **Package**: pnpm\n- **Versions**: All versions using `@pnpm/config.env-replace` and `loadToken` functionality\n- **File**: `pnpm/network/auth-header/src/getAuthHeadersFromConfig.ts` - `loadToken()` function\n- **File**: `pnpm/config/config/src/readLocalConfig.ts` - `.npmrc` environment variable substitution\n\n## Technical Details\n\n### Vulnerability Chain\n\n1. **Environment Variable Substitution**\n - `.npmrc` supports `${VAR}` syntax\n - Substitution occurs in `readLocalConfig()`\n\n2. **loadToken Execution**\n - Uses `spawnSync(helperPath, { shell: true })`\n - Only validates absolute path existence\n\n3. **Attack Flow**\n```\n.npmrc: registry.npmjs.org/:tokenHelper=${HELPER_PATH}\n \u2193\nenvReplace() \u2192 /tmp/evil-helper.sh\n \u2193\nloadToken() \u2192 spawnSync(..., { shell: true })\n \u2193\nRCE achieved\n```\n\n### Code Evidence\n\n**`pnpm/config/config/src/readLocalConfig.ts:17-18`**\n```typescript\nkey = envReplace(key, process.env)\nini[key] = parseField(types, envReplace(val, process.env), key)\n```\n\n**`pnpm/network/auth-header/src/getAuthHeadersFromConfig.ts:60-71`**\n```typescript\nexport function loadToken(helperPath: string, settingName: string): string {\n if (!path.isAbsolute(helperPath) || !fs.existsSync(helperPath)) {\n throw new PnpmError(\u0027BAD_TOKEN_HELPER_PATH\u0027, ...)\n }\n const spawnResult = spawnSync(helperPath, { shell: true })\n // ...\n}\n```\n\n## Proof of Concept\n\n### Prerequisites\n- Private npm registry access\n- Control over environment variables\n- Ability to place scripts in filesystem\n\n### PoC Steps\n\n```bash\n# 1. Create malicious helper script\ncat \u003e /tmp/evil-helper.sh \u003c\u003c \u0027SCRIPT\u0027\n#!/bin/bash\necho \"RCE SUCCESS!\" \u003e /tmp/rce-log.txt\necho \"TOKEN_12345\"\nSCRIPT\nchmod +x /tmp/evil-helper.sh\n\n# 2. Create .npmrc with environment variable\ncat \u003e .npmrc \u003c\u003c \u0027EOF\u0027\nregistry=https://registry.npmjs.org/\nregistry.npmjs.org/:tokenHelper=${HELPER_PATH}\nEOF\n\n# 3. Set environment variable (attacker controlled)\nexport HELPER_PATH=/tmp/evil-helper.sh\n\n# 4. Trigger pnpm install\npnpm install # RCE occurs during auth\n\n# 5. Verify attack\ncat /tmp/rce-log.txt\n```\n\n### PoC Results\n```\n==\u003e Attack successful\n==\u003e File created: /tmp/rce-log.txt\n==\u003e Arbitrary code execution confirmed\n```\n\n## Impact\n\n### Severity\n- **CVSS Score**: 7.6 (High)\n- **CVSS Vector**: cvss:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H\n\n### Affected Environments\n\n**High Risk:**\n- CI/CD pipelines (GitHub Actions, GitLab CI)\n- Docker build environments\n- Kubernetes deployments\n- Private registry users\n\n**Low Risk:**\n- Public registry only\n- Production runtime (no pnpm execution)\n- Static sites\n\n### Attack Scenarios\n\n**Scenario 1: CI/CD Supply Chain**\n```\nRepository \u2192 Build Trigger \u2192 pnpm install \u2192 RCE \u2192 Production Deploy\n```\n\n**Scenario 2: Docker Build**\n```dockerfile\nFROM node:20\nARG HELPER_PATH=/tmp/evil\nCOPY .npmrc .\nRUN pnpm install # RCE\n```\n\n**Scenario 3: Kubernetes**\n```\nSecret Control \u2192 Env Variable \u2192 .npmrc Substitution \u2192 RCE\n```\n\n## Mitigation\n\n### Temporary Workarounds\n\n**Disable tokenHelper:**\n```ini\n# .npmrc\n# registry.npmjs.org/:tokenHelper=${HELPER_PATH}\n```\n\n**Use direct tokens:**\n```ini\n//registry.npmjs.org/:_authToken=YOUR_TOKEN\n```\n\n**Audit environment variables:**\n- Review CI/CD env vars\n- Restrict .npmrc changes\n- Monitor build logs\n\n### Recommended Fixes\n\n1. Remove `shell: true` from loadToken\n2. Implement helper path allowlist\n3. Validate substituted paths\n4. Consider sandboxing\n\n## Disclosure\n\n- **Discovery**: 2025-11-02\n- **PoC**: 2025-11-02\n- **Report**: [Pending disclosure decision]\n\n## References\n\n- Repository: https://github.com/pnpm/pnpm\n- Affected: `@pnpm/config.env-replace@^3.0.2`\n- Similar: CVE-2024-53866, CVE-2023-37478\n\n## Credit\n\nReported by: Jiyong Yang\nContact: sy2n0@naver.com",
"id": "GHSA-2phv-j68v-wwqx",
"modified": "2026-01-08T20:07:34Z",
"published": "2026-01-07T18:51:07Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/pnpm/pnpm/security/advisories/GHSA-2phv-j68v-wwqx"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-69262"
},
{
"type": "PACKAGE",
"url": "https://github.com/pnpm/pnpm"
},
{
"type": "WEB",
"url": "https://github.com/pnpm/pnpm/releases/tag/v10.27.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "pnpm vulnerable to Command Injection via environment variable substitution"
}
GHSA-2PJP-4C9P-2RHV
Vulnerability from github – Published: 2022-05-14 03:19 – Updated: 2022-05-14 03:19Cosmo 1.0.0Beta6 allows attackers to execute arbitrary PHP code via the Database Prefix field on the Database Info screen of install.php.
{
"affected": [],
"aliases": [
"CVE-2018-10429"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-04-26T17:29:00Z",
"severity": "CRITICAL"
},
"details": "Cosmo 1.0.0Beta6 allows attackers to execute arbitrary PHP code via the Database Prefix field on the Database Info screen of install.php.",
"id": "GHSA-2pjp-4c9p-2rhv",
"modified": "2022-05-14T03:19:26Z",
"published": "2022-05-14T03:19:26Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-10429"
},
{
"type": "WEB",
"url": "https://github.com/CosmoCMS/Cosmo/issues/405"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
Mitigation
Strategy: Refactoring
Refactor your program so that you do not have to dynamically generate code.
Mitigation
- Run your code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which code can be executed by your product.
- Examples include the Unix chroot jail and AppArmor. In general, managed code may provide some protection.
- This may not be a feasible solution, and it only limits the impact to the operating system; the rest of your application may still be subject to compromise.
- Be careful to avoid CWE-243 and other weaknesses related to jails.
Mitigation MIT-5
Strategy: Input Validation
- Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
- When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
- Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
- To reduce the likelihood of code injection, use stringent allowlists that limit which constructs are allowed. If you are dynamically constructing code that invokes a function, then verifying that the input is alphanumeric might be insufficient. An attacker might still be able to reference a dangerous function that you did not intend to allow, such as system(), exec(), or exit().
Mitigation
Use dynamic tools and techniques that interact with the product using large test suites with many diverse inputs, such as fuzz testing (fuzzing), robustness testing, and fault injection. The product's operation may slow down, but it should not become unstable, crash, or generate incorrect results.
Mitigation MIT-32
Strategy: Compilation or Build Hardening
Run the code in an environment that performs automatic taint propagation and prevents any command execution that uses tainted variables, such as Perl's "-T" switch. This will force the program to perform validation steps that remove the taint, although you must be careful to correctly validate your inputs so that you do not accidentally mark dangerous inputs as untainted (see CWE-183 and CWE-184).
Mitigation MIT-32
Strategy: Environment Hardening
Run the code in an environment that performs automatic taint propagation and prevents any command execution that uses tainted variables, such as Perl's "-T" switch. This will force the program to perform validation steps that remove the taint, although you must be careful to correctly validate your inputs so that you do not accidentally mark dangerous inputs as untainted (see CWE-183 and CWE-184).
Mitigation
For Python programs, it is frequently encouraged to use the ast.literal_eval() function instead of eval, since it is intentionally designed to avoid executing code. However, an adversary could still cause excessive memory or stack consumption via deeply nested structures [REF-1372], so the python documentation discourages use of ast.literal_eval() on untrusted data [REF-1373].
CAPEC-242: Code Injection
An adversary exploits a weakness in input validation on the target to inject new code into that which is currently executing. This differs from code inclusion in that code inclusion involves the addition or replacement of a reference to a code file, which is subsequently loaded by the target and used as part of the code of some application.
CAPEC-35: Leverage Executable Code in Non-Executable Files
An attack of this type exploits a system's trust in configuration and resource files. When the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high.
CAPEC-77: Manipulating User-Controlled Variables
This attack targets user controlled variables (DEBUG=1, PHP Globals, and So Forth). An adversary can override variables leveraging user-supplied, untrusted query variables directly used on the application server without any data sanitization. In extreme cases, the adversary can change variables controlling the business logic of the application. For instance, in languages like PHP, a number of poorly set default configurations may allow the user to override variables.