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.
8420 vulnerabilities reference this CWE, most recent first.
GHSA-4R5X-X283-WM96
Vulnerability from github – Published: 2023-10-24 19:47 – Updated: 2023-10-24 19:47Impact
An authenticated user can exploit a vulnerability in MongoDB sessions to execute arbitrary commands, leading to remote code execution. This vulnerability may further be leveraged to gain root privileges on the host system.
Details
Through the WEB CLI interface provided by koko, a user logs into the authorized mongoDB database and exploits the MongoDB session to execute arbitrary commands.
admin> const { execSync } = require("child_process")
admin> console.log(execSync("id; hostname;").toString())
uid=0(root) gid=0(root) groups=0(root)
jms_koko
admin>
Patches
Safe versions: - v2.28.20 - v3.7.1
Workarounds
It is recommended to upgrade the safe versions.
After upgrade, you can use the same method to check whether the vulnerability is fixed.
admin> console.log(execSync("id; hostname;").toString())
/bin/sh: line 1: /bin/hostname: Permission denied
References
Thanks for Oskar Zeino-Mahmalat of Sonar found and report this vulnerability
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/jumpserver/koko"
},
"ranges": [
{
"events": [
{
"introduced": "2.0.0"
},
{
"fixed": "2.28.20"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Go",
"name": "github.com/jumpserver/koko"
},
"ranges": [
{
"events": [
{
"introduced": "3.0.0"
},
{
"fixed": "3.7.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-43651"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2023-10-24T19:47:50Z",
"nvd_published_at": "2023-09-27T21:15:10Z",
"severity": "MODERATE"
},
"details": "### Impact\n\nAn authenticated user can exploit a vulnerability in MongoDB sessions to execute arbitrary commands, leading to remote code execution. This vulnerability may further be leveraged to gain root privileges on the host system.\n\n### Details\nThrough the WEB CLI interface provided by koko, a user logs into the authorized mongoDB database and exploits the MongoDB session to execute arbitrary commands.\n\n```\nadmin\u003e const { execSync } = require(\"child_process\")\nadmin\u003e console.log(execSync(\"id; hostname;\").toString())\nuid=0(root) gid=0(root) groups=0(root)\njms_koko\nadmin\u003e \n```\n\n### Patches\nSafe versions: \n- v2.28.20\n- v3.7.1 \n\n### Workarounds\nIt is recommended to upgrade the safe versions.\n\nAfter upgrade, you can use the same method to check whether the vulnerability is fixed.\n```\nadmin\u003e console.log(execSync(\"id; hostname;\").toString())\n/bin/sh: line 1: /bin/hostname: Permission denied\n```\n\n### References\nThanks for **Oskar Zeino-Mahmalat** of [Sonar](https://sonarsource.com/) found and report this vulnerability ",
"id": "GHSA-4r5x-x283-wm96",
"modified": "2023-10-24T19:47:50Z",
"published": "2023-10-24T19:47:50Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/jumpserver/jumpserver/security/advisories/GHSA-4r5x-x283-wm96"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-43651"
},
{
"type": "WEB",
"url": "https://github.com/jumpserver/koko/commit/7d80db95d17c8f42bdf50260dfc21dc2bd0452c2"
},
{
"type": "WEB",
"url": "https://github.com/jumpserver/koko/commit/857f8b9e41f0930dc6190a35d8601fffa5e884e7"
},
{
"type": "PACKAGE",
"url": "https://github.com/jumpserver/koko"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:H",
"type": "CVSS_V3"
}
],
"summary": "Jumpserver Koko vulnerable to remote code execution on the host system via MongoDB shell "
}
GHSA-4R7C-FR6M-VGJF
Vulnerability from github – Published: 2026-01-22 18:30 – Updated: 2026-01-28 18:30Improper Control of Generation of Code ('Code Injection') vulnerability in Nelio Software Nelio AB Testing nelio-ab-testing allows Code Injection.This issue affects Nelio AB Testing: from n/a through <= 8.1.8.
{
"affected": [],
"aliases": [
"CVE-2025-67944"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-01-22T17:16:04Z",
"severity": "CRITICAL"
},
"details": "Improper Control of Generation of Code (\u0027Code Injection\u0027) vulnerability in Nelio Software Nelio AB Testing nelio-ab-testing allows Code Injection.This issue affects Nelio AB Testing: from n/a through \u003c= 8.1.8.",
"id": "GHSA-4r7c-fr6m-vgjf",
"modified": "2026-01-28T18:30:41Z",
"published": "2026-01-22T18:30:33Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-67944"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/Wordpress/Plugin/nelio-ab-testing/vulnerability/wordpress-nelio-ab-testing-plugin-8-1-8-arbitrary-code-execution-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-4R8Q-2FRH-4J22
Vulnerability from github – Published: 2022-05-14 01:57 – Updated: 2022-05-14 01:57AttacheCase ver.3.3.0.0 and earlier allows an arbitrary script execution via unspecified vectors.
{
"affected": [],
"aliases": [
"CVE-2018-0675"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-09-04T13:29:00Z",
"severity": "HIGH"
},
"details": "AttacheCase ver.3.3.0.0 and earlier allows an arbitrary script execution via unspecified vectors.",
"id": "GHSA-4r8q-2frh-4j22",
"modified": "2022-05-14T01:57:33Z",
"published": "2022-05-14T01:57:33Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-0675"
},
{
"type": "WEB",
"url": "https://hibara.org/software/attachecase/?lang=en"
},
{
"type": "WEB",
"url": "http://jvn.jp/en/jp/JVN02037158/index.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-4R9R-4425-74P7
Vulnerability from github – Published: 2026-07-28 14:50 – Updated: 2026-07-28 14:50Summary
CedarJava is an open source Java implementation of the Cedar policy language, used for fine-grained authorization decisions. Under certain circumstances, it could lead to incorrect equality comparisons.
Impact
EntityIdentifier.equals() has inverted null/self branches
The EntityIdentifier.equals() method has inverted logic for null and self-reference checks, returning true for null comparisons and false for self-comparisons. This does not affect Cedar authorization decisions (computed in Rust from JSON), but could affect integrators who perform their own equality checks on entity identifiers.
Impacted versions:
< 4.9
Patches
It has been addressed in CedarJava version 4.9 and above. We recommend upgrading to the latest version and ensuring any forked or derivative code is patched to incorporate the new fixes.
Workarounds
Avoid relying on EntityIdentifier.equals() for security-sensitive comparisons until upgraded to version 4.9.
References
If you have any questions or comments about this advisory, Cedar asks that you contact us directly via email to cedar-policy-security@lists.cncf.io. Please do not create a public GitHub issue.
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "com.cedarpolicy:cedar-java"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.3.6"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "com.cedarpolicy:cedar-java"
},
"ranges": [
{
"events": [
{
"introduced": "3.1.2"
},
{
"fixed": "3.4.1"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "com.cedarpolicy:cedar-java"
},
"ranges": [
{
"events": [
{
"introduced": "4.0.0"
},
{
"fixed": "4.9.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-55771"
],
"database_specific": {
"cwe_ids": [
"CWE-94",
"CWE-697",
"CWE-843"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-28T14:50:25Z",
"nvd_published_at": "2026-07-13T20:16:48Z",
"severity": "HIGH"
},
"details": "### Summary\n\nCedarJava is an open source Java implementation of the Cedar policy language, used for fine-grained authorization decisions. Under certain circumstances, it could lead to incorrect equality comparisons.\n\n### Impact\n\n**`EntityIdentifier.equals()` has inverted null/self branches**\n\nThe `EntityIdentifier.equals()` method has inverted logic for null and self-reference checks, returning true for null comparisons and false for self-comparisons. This does not affect Cedar authorization decisions (computed in Rust from JSON), but could affect integrators who perform their own equality checks on entity identifiers.\n\n### Impacted versions: \n\u003c 4.9\n\n### Patches\nIt has been addressed in CedarJava version 4.9 and above. We recommend upgrading to the latest version and ensuring any forked or derivative code is patched to incorporate the new fixes.\n\n### Workarounds\nAvoid relying on `EntityIdentifier.equals()` for security-sensitive comparisons until upgraded to version `4.9`.\n\n### References\nIf you have any questions or comments about this advisory, Cedar asks that you contact us directly via email to [cedar-policy-security@lists.cncf.io](mailto:cedar-policy-security@lists.cncf.io). Please do not create a public GitHub issue.",
"id": "GHSA-4r9r-4425-74p7",
"modified": "2026-07-28T14:50:25Z",
"published": "2026-07-28T14:50:25Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/cedar-policy/cedar-java/security/advisories/GHSA-4r9r-4425-74p7"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-55771"
},
{
"type": "PACKAGE",
"url": "https://github.com/cedar-policy/cedar-java"
}
],
"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"
}
],
"summary": "Cedar-Java has policy injection, type confusion, and incorrect equality comparison vulnerabilities"
}
GHSA-4RCF-F8M4-G24G
Vulnerability from github – Published: 2022-05-01 17:59 – Updated: 2022-05-01 17:59Multiple PHP remote file inclusion vulnerabilities in Turnkey Web Tools SunShop Shopping Cart before 3.5.1 allow remote attackers to execute arbitrary PHP code via a URL in the abs_path parameter to (1) index.php or (2) checkout.php.
{
"affected": [],
"aliases": [
"CVE-2007-2070"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-04-18T03:19:00Z",
"severity": "HIGH"
},
"details": "Multiple PHP remote file inclusion vulnerabilities in Turnkey Web Tools SunShop Shopping Cart before 3.5.1 allow remote attackers to execute arbitrary PHP code via a URL in the abs_path parameter to (1) index.php or (2) checkout.php.",
"id": "GHSA-4rcf-f8m4-g24g",
"modified": "2022-05-01T17:59:44Z",
"published": "2022-05-01T17:59:44Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-2070"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/33670"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/3748"
},
{
"type": "WEB",
"url": "http://osvdb.org/37414"
},
{
"type": "WEB",
"url": "http://osvdb.org/37415"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/23511"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2007/1422"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-4RCH-2FH8-94VW
Vulnerability from github – Published: 2024-04-23 06:30 – Updated: 2024-04-23 20:50Versions of the package mysql2 before 3.9.7 are vulnerable to Arbitrary Code Injection due to improper sanitization of the timezone parameter in the readCodeFor function by calling a native MySQL Server date/time function.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "mysql2"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.9.7"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-21511"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2024-04-23T20:50:56Z",
"nvd_published_at": "2024-04-23T05:15:48Z",
"severity": "CRITICAL"
},
"details": "Versions of the package mysql2 before 3.9.7 are vulnerable to Arbitrary Code Injection due to improper sanitization of the timezone parameter in the readCodeFor function by calling a native MySQL Server date/time function.",
"id": "GHSA-4rch-2fh8-94vw",
"modified": "2024-04-23T20:50:56Z",
"published": "2024-04-23T06:30:47Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-21511"
},
{
"type": "WEB",
"url": "https://github.com/sidorares/node-mysql2/pull/2608"
},
{
"type": "WEB",
"url": "https://github.com/sidorares/node-mysql2/commit/7d4b098c7e29d5a6cb9eac2633bfcc2f0f1db713"
},
{
"type": "PACKAGE",
"url": "https://github.com/sidorares/node-mysql2"
},
{
"type": "WEB",
"url": "https://github.com/sidorares/node-mysql2/releases/tag/v3.9.7"
},
{
"type": "WEB",
"url": "https://security.snyk.io/vuln/SNYK-JS-MYSQL2-6670046"
}
],
"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"
}
],
"summary": "MySQL2 for Node Arbitrary Code Injection"
}
GHSA-4RG2-XC78-49M2
Vulnerability from github – Published: 2022-05-01 18:29 – Updated: 2025-04-09 03:46Multiple PHP remote file inclusion vulnerabilities in pSlash 0.70 allow remote attackers to execute arbitrary PHP code via a URL in (1) the lvc_admin_dir parameter to modules/visitors2/admin/view-archiver.inc.php or (2) the lvc_include_dir parameter to modules/visitors2/include/menus.inc.php. NOTE: the modules/visitors2/include/config.inc.php vector is already covered by CVE-2006-4373. NOTE: vector 1 is disputed by CVE because PHP encounters a fatal instantiation error on a direct request for the file, before reaching the include statement.
{
"affected": [],
"aliases": [
"CVE-2007-5014"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-09-20T21:17:00Z",
"severity": "HIGH"
},
"details": "Multiple PHP remote file inclusion vulnerabilities in pSlash 0.70 allow remote attackers to execute arbitrary PHP code via a URL in (1) the lvc_admin_dir parameter to modules/visitors2/admin/view-archiver.inc.php or (2) the lvc_include_dir parameter to modules/visitors2/include/menus.inc.php. NOTE: the modules/visitors2/include/config.inc.php vector is already covered by CVE-2006-4373. NOTE: vector 1 is disputed by CVE because PHP encounters a fatal instantiation error on a direct request for the file, before reaching the include statement.",
"id": "GHSA-4rg2-xc78-49m2",
"modified": "2025-04-09T03:46:26Z",
"published": "2022-05-01T18:29:21Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-5014"
},
{
"type": "WEB",
"url": "http://arfis.wordpress.com/2007/09/14/rfi-03-pslash"
},
{
"type": "WEB",
"url": "http://osvdb.org/38288"
},
{
"type": "WEB",
"url": "http://osvdb.org/38289"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-4RJP-9XF6-39JC
Vulnerability from github – Published: 2022-05-01 18:35 – Updated: 2022-05-01 18:35Multiple PHP remote file inclusion vulnerabilities in PeopleAggregator 1.2pre6, when register_globals is enabled, allow remote attackers to execute arbitrary PHP code via a URL in the current_blockmodule_path parameter to (1) AudiosMediaGalleryModule/AudiosMediaGalleryModule.php, (2) ImagesMediaGalleryModule/ImagesMediaGalleryModule.php, (3) MembersFacewallModule/MembersFacewallModule.php, (4) NewestGroupsModule/NewestGroupsModule.php, (5) UploadMediaModule/UploadMediaModule.php, and (6) VideosMediaGalleryModule/VideosMediaGalleryModule.php in BetaBlockModules/; and (7) the path_prefix parameter to several components.
{
"affected": [],
"aliases": [
"CVE-2007-5631"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-10-23T17:46:00Z",
"severity": "MODERATE"
},
"details": "Multiple PHP remote file inclusion vulnerabilities in PeopleAggregator 1.2pre6, when register_globals is enabled, allow remote attackers to execute arbitrary PHP code via a URL in the current_blockmodule_path parameter to (1) AudiosMediaGalleryModule/AudiosMediaGalleryModule.php, (2) ImagesMediaGalleryModule/ImagesMediaGalleryModule.php, (3) MembersFacewallModule/MembersFacewallModule.php, (4) NewestGroupsModule/NewestGroupsModule.php, (5) UploadMediaModule/UploadMediaModule.php, and (6) VideosMediaGalleryModule/VideosMediaGalleryModule.php in BetaBlockModules/; and (7) the path_prefix parameter to several components.",
"id": "GHSA-4rjp-9xf6-39jc",
"modified": "2022-05-01T18:35:20Z",
"published": "2022-05-01T18:35:20Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-5631"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/37349"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/4551"
},
{
"type": "WEB",
"url": "http://osvdb.org/45495"
},
{
"type": "WEB",
"url": "http://osvdb.org/45496"
},
{
"type": "WEB",
"url": "http://osvdb.org/45497"
},
{
"type": "WEB",
"url": "http://osvdb.org/45498"
},
{
"type": "WEB",
"url": "http://osvdb.org/45499"
},
{
"type": "WEB",
"url": "http://osvdb.org/45500"
},
{
"type": "WEB",
"url": "http://osvdb.org/45501"
},
{
"type": "WEB",
"url": "http://www.myelin.co.nz/post/2007/11/12/#200711121"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/483571/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/26147"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-4RM2-28VJ-FJ39
Vulnerability from github – Published: 2026-05-06 19:54 – Updated: 2026-05-13 16:41Impact
A remote code execution (RCE) vulnerability affects versions 0.13.2 through 0.13.21. When documentation endpoints are publicly accessible and validation rules reference user-controlled input, request supplied data may be evaluated during documentation generation, leading to execution of arbitrary PHP code in the application context.
Patches
Fixed in version 0.13.22.
Workarounds
If upgrading is not immediately possible:
- Restrict access to documentation endpoints (
/docs/api,/docs/api.json) - Avoid using user-controlled variables inside validation rule expressions (e.g., values derived from request input)
- Disable documentation endpoints in production environments if not required
These measures significantly reduce or prevent exploitability.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 0.13.21"
},
"package": {
"ecosystem": "Packagist",
"name": "dedoc/scramble"
},
"ranges": [
{
"events": [
{
"introduced": "0.13.2"
},
{
"fixed": "0.13.22"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-44262"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-05-06T19:54:56Z",
"nvd_published_at": "2026-05-12T22:16:36Z",
"severity": "CRITICAL"
},
"details": "### Impact\n\nA remote code execution (RCE) vulnerability affects versions `0.13.2` through `0.13.21`. When documentation endpoints are publicly accessible and validation rules reference user-controlled input, request supplied data may be evaluated during documentation generation, leading to execution of arbitrary PHP code in the application context.\n\n### Patches\n\nFixed in version `0.13.22`.\n\n### Workarounds\n\nIf upgrading is not immediately possible:\n\n* Restrict access to documentation endpoints (`/docs/api`, `/docs/api.json`)\n* Avoid using user-controlled variables inside validation rule expressions (e.g., values derived from request input)\n* Disable documentation endpoints in production environments if not required\n\nThese measures significantly reduce or prevent exploitability.",
"id": "GHSA-4rm2-28vj-fj39",
"modified": "2026-05-13T16:41:47Z",
"published": "2026-05-06T19:54:56Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/dedoc/scramble/security/advisories/GHSA-4rm2-28vj-fj39"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-44262"
},
{
"type": "PACKAGE",
"url": "https://github.com/dedoc/scramble"
},
{
"type": "WEB",
"url": "https://github.com/dedoc/scramble/releases/tag/v0.13.22"
}
],
"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:L",
"type": "CVSS_V3"
}
],
"summary": "Scramble vulnerable to remote code execution via evaluation of user-controlled input in validation rules"
}
GHSA-4RMG-292M-WG3W
Vulnerability from github – Published: 2024-05-29 18:44 – Updated: 2025-11-04 16:50Impact
Template authors could inject php code by choosing a malicous file name for an extends-tag. Users that cannot fully trust template authors should update asap.
Patches
Please upgrade to the most recent version of Smarty v4 or v5. There is no patch for v3.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "smarty/smarty"
},
"ranges": [
{
"events": [
{
"introduced": "5.0.0"
},
{
"fixed": "5.1.1"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "smarty/smarty"
},
"ranges": [
{
"events": [
{
"introduced": "3.0.0"
},
{
"fixed": "4.5.3"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-35226"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2024-05-29T18:44:30Z",
"nvd_published_at": "2024-05-28T21:16:30Z",
"severity": "HIGH"
},
"details": "### Impact\nTemplate authors could inject php code by choosing a malicous file name for an extends-tag. Users that cannot fully trust template authors should update asap.\n\n### Patches\nPlease upgrade to the most recent version of Smarty v4 or v5. There is no patch for v3.",
"id": "GHSA-4rmg-292m-wg3w",
"modified": "2025-11-04T16:50:38Z",
"published": "2024-05-29T18:44:30Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/smarty-php/smarty/security/advisories/GHSA-4rmg-292m-wg3w"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-35226"
},
{
"type": "WEB",
"url": "https://github.com/smarty-php/smarty/commit/0be92bc8a6fb83e6e0d883946f7e7c09ba4e857a"
},
{
"type": "PACKAGE",
"url": "https://github.com/smarty-php/smarty"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2024/11/msg00013.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "Smarty vulnerable to PHP Code Injection by malicious attribute in extends-tag"
}
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.