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.
8285 vulnerabilities reference this CWE, most recent first.
GHSA-H9HG-759G-265V
Vulnerability from github – Published: 2022-03-29 00:01 – Updated: 2022-04-06 00:02Clash for Windows v0.19.8 was discovered to allow arbitrary code execution via a crafted payload injected into the Proxies name column.
{
"affected": [],
"aliases": [
"CVE-2022-26255"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-03-28T00:15:00Z",
"severity": "CRITICAL"
},
"details": "Clash for Windows v0.19.8 was discovered to allow arbitrary code execution via a crafted payload injected into the Proxies name column.",
"id": "GHSA-h9hg-759g-265v",
"modified": "2022-04-06T00:02:13Z",
"published": "2022-03-29T00:01:16Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-26255"
},
{
"type": "WEB",
"url": "https://github.com/Fndroid/clash_for_windows_pkg/issues/2710"
}
],
"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-H9M9-95J2-CPMJ
Vulnerability from github – Published: 2023-02-20 18:30 – Updated: 2024-07-23 21:31PHP code injection in watolib auth.php and hosttags.php in Tribe29's Checkmk <= 2.1.0p10, Checkmk <= 2.0.0p27, and Checkmk <= 1.6.0p29 allows an attacker to inject and execute PHP code which will be executed upon request of the vulnerable component.
{
"affected": [],
"aliases": [
"CVE-2022-46836"
],
"database_specific": {
"cwe_ids": [
"CWE-20",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-02-20T17:15:00Z",
"severity": "HIGH"
},
"details": "PHP code injection in watolib auth.php and hosttags.php in Tribe29\u0027s Checkmk \u003c= 2.1.0p10, Checkmk \u003c= 2.0.0p27, and Checkmk \u003c= 1.6.0p29 allows an attacker to inject and execute PHP code which will be executed upon request of the vulnerable component.",
"id": "GHSA-h9m9-95j2-cpmj",
"modified": "2024-07-23T21:31:32Z",
"published": "2023-02-20T18:30:16Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-46836"
},
{
"type": "WEB",
"url": "https://checkmk.com/werk/14383"
},
{
"type": "WEB",
"url": "https://www.sonarsource.com/blog/checkmk-rce-chain-3"
}
],
"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-H9QX-V5XP-PH8P
Vulnerability from github – Published: 2026-07-07 13:01 – Updated: 2026-07-07 13:01Summary
A critical vulnerability has been identified in EGroupware that may lead to Remote Code Execution (RCE). The issue allows an authenticated attacker to execute arbitrary commands on the server. If user self-registration is enabled, the vulnerability may be exploitable without prior authentication.
The vulnerability stems from improper authorization checks combined with a file write primitive and an arbitrary file read vulnerability, which together enable full system compromise.
Details
1. Improper Authorization in SmallPartMediaRecorder::ajax_upload()
The vulnerability originates in:
EGroupware\SmallParT\Widgets\SmallPartMediaRecorder::ajax_upload()
The function attempts to verify whether the current user is a teacher of the specified course ID before allowing a file upload.
The critical authorization check ensures that the course access control list (ACL) contains:
$required_acl (self::ROLE_TEACHER, i.e., 3)
However, the course_aclvalue is derived from user-controlled request data.
Bypass Technique
A crafted request can manipulate the participant_rolevalue inside the request body:
{
"video": {
"course_id": {
"participants": [
{
"account_id": "7",
"name": "Test",
"joined_at": "2026-01-10",
"participant_role": 3
}
],
"account_id": "7",
"course_id": "1"
},
"video_hash": ".",
"video_type": "file_here"
}
}
Because the course ACL is taken from participant_role, setting it to 3 allows bypassing the isTeachercheck.
2. Arbitrary File Write
After bypassing authorization, the function uploads the provided file into a controllable file path.
The file path is derived from the video_type(or video_path) value, enabling path traversal.
Due to file permission restrictions (server running as www-data), writable targets are limited. One viable target is ./header.inc.php
3. Constraints
Writing a simple PHP webshell may not immediately execute due to OPcache.
An invalid header.inc.php file will break the system and prevent the server from running.
Therefore, a valid file structure must be preserved.
4. Arbitrary File Read
A second vulnerability allows arbitrary file read via:
/egroupware/index.php?menuaction=importexport.importexport_export_ui.download&_filename=../../../usr/share/egroupware/header.inc.php&_suffix=txt&_type=text/plain&filename=leak
The issue resides in:
importexport_export_ui::download
The _filenameparameter is user-controlled and used to read arbitrary files.
This allows retrieving the original header.inc.php content.
5. Achieving Remote Code Execution
By combining: Arbitrary file read (to retrieve valid header.inc.php); Arbitrary file write (to overwrite it with modified content), an attacker can inject controlled PHP code while preserving file validity.
This results in Remote Code Execution after server restart, or OPcache expiration. An alternative impact includes modifying the admin setup password to gain full system control.
Impact
Remote Code Execution Full system compromise Arbitrary file read Arbitrary file write Potential complete takeover of EGroupware instance
Reported by
This finding was discovered by Huong Kieu of Cenobe Security (https://cenobe.com/)
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "egroupware/egroupware"
},
"ranges": [
{
"events": [
{
"introduced": "26.0.20251208"
},
{
"fixed": "26.2.20260224"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "egroupware/egroupware"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "23.1.20260224"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-27823"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-639",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-07T13:01:01Z",
"nvd_published_at": null,
"severity": "CRITICAL"
},
"details": "## Summary\nA critical vulnerability has been identified in EGroupware that may lead to Remote Code Execution (RCE).\nThe issue allows an authenticated attacker to execute arbitrary commands on the server. If user self-registration is enabled, the vulnerability may be exploitable without prior authentication.\n\nThe vulnerability stems from improper authorization checks combined with a file write primitive and an arbitrary file read vulnerability, which together enable full system compromise.\n\n## Details\n### 1. Improper Authorization in SmallPartMediaRecorder::ajax_upload()\n\nThe vulnerability originates in:\n\n`EGroupware\\SmallParT\\Widgets\\SmallPartMediaRecorder::ajax_upload()`\n\nThe function attempts to verify whether the current user is a teacher of the specified course ID before allowing a file upload.\n\nThe critical authorization check ensures that the course access control list (ACL) contains:\n\n`$required_acl (self::ROLE_TEACHER, i.e., 3)`\n\nHowever, the `course_acl `value is derived from user-controlled request data.\n\n**_Bypass Technique_**\n\nA crafted request can manipulate the `participant_role `value inside the request body:\n\n```json\n{\n \"video\": {\n \"course_id\": {\n \"participants\": [\n {\n \"account_id\": \"7\",\n \"name\": \"Test\",\n \"joined_at\": \"2026-01-10\",\n \"participant_role\": 3\n }\n ],\n \"account_id\": \"7\",\n \"course_id\": \"1\"\n },\n \"video_hash\": \".\",\n \"video_type\": \"file_here\"\n }\n}\n```\n\nBecause the course ACL is taken from `participant_role`, setting it to 3 allows bypassing the `isTeacher `check.\n\n### 2. Arbitrary File Write\n\nAfter bypassing authorization, the function uploads the provided file into a controllable file path.\n\nThe file path is derived from the `video_type `(or video_path) value, enabling path traversal.\n\nDue to file permission restrictions (server running as www-data), writable targets are limited. One viable target is `./header.inc.php`\n\n### 3. Constraints\n\nWriting a simple PHP webshell may not immediately execute due to OPcache.\n\nAn invalid `header.inc.php` file will break the system and prevent the server from running.\n\nTherefore, a valid file structure must be preserved.\n\n### 4. Arbitrary File Read\n\nA second vulnerability allows arbitrary file read via:\n\n`/egroupware/index.php?menuaction=importexport.importexport_export_ui.download\u0026_filename=../../../usr/share/egroupware/header.inc.php\u0026_suffix=txt\u0026_type=text/plain\u0026filename=leak`\n\nThe issue resides in:\n\n`importexport_export_ui::download`\n\nThe `_filename `parameter is user-controlled and used to read arbitrary files.\n\nThis allows retrieving the original `header.inc.php` content.\n\n### 5. Achieving Remote Code Execution\n\nBy combining: Arbitrary file read (to retrieve valid header.inc.php); Arbitrary file write (to overwrite it with modified content), an attacker can inject controlled PHP code while preserving file validity.\n\nThis results in Remote Code Execution after server restart, or OPcache expiration. An alternative impact includes modifying the admin setup password to gain full system control.\n\n## Impact\nRemote Code Execution\nFull system compromise\nArbitrary file read\nArbitrary file write\nPotential complete takeover of EGroupware instance\n\n## Reported by\nThis finding was discovered by Huong Kieu of Cenobe Security (https://cenobe.com/)",
"id": "GHSA-h9qx-v5xp-ph8p",
"modified": "2026-07-07T13:01:01Z",
"published": "2026-07-07T13:01:01Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/EGroupware/egroupware/security/advisories/GHSA-h9qx-v5xp-ph8p"
},
{
"type": "PACKAGE",
"url": "https://github.com/EGroupware/egroupware"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "EGroupware has a Remote Code Execution Vulnerability"
}
GHSA-H9RV-G9XH-2PQ2
Vulnerability from github – Published: 2022-05-14 01:01 – Updated: 2022-05-14 01:01Microsoft Windows Vista SP2, Windows Server 2008 SP2 and R2 SP1, Windows 7 SP1, Windows 8, Windows 8.1, Windows Server 2012 Gold and R2, and Windows RT Gold and 8.1 allow remote attackers to execute arbitrary code via a crafted Journal file, aka "Windows Journal Remote Code Execution Vulnerability," a different vulnerability than CVE-2015-1675, CVE-2015-1695, CVE-2015-1697, CVE-2015-1698, and CVE-2015-1699.
{
"affected": [],
"aliases": [
"CVE-2015-1696"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2015-05-13T10:59:00Z",
"severity": "HIGH"
},
"details": "Microsoft Windows Vista SP2, Windows Server 2008 SP2 and R2 SP1, Windows 7 SP1, Windows 8, Windows 8.1, Windows Server 2012 Gold and R2, and Windows RT Gold and 8.1 allow remote attackers to execute arbitrary code via a crafted Journal file, aka \"Windows Journal Remote Code Execution Vulnerability,\" a different vulnerability than CVE-2015-1675, CVE-2015-1695, CVE-2015-1697, CVE-2015-1698, and CVE-2015-1699.",
"id": "GHSA-h9rv-g9xh-2pq2",
"modified": "2022-05-14T01:01:35Z",
"published": "2022-05-14T01:01:35Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2015-1696"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2015/ms15-045"
},
{
"type": "WEB",
"url": "https://www.verisign.com/en_US/security-services/security-intelligence/vulnerability-reports/articles/index.xhtml?id=1095"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id/1032280"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-H9XH-G5PC-79X3
Vulnerability from github – Published: 2025-12-13 18:30 – Updated: 2025-12-13 18:30The The Shortcode Ajax plugin for WordPress is vulnerable to arbitrary shortcode execution in all versions up to, and including, 1.0. This is due to the software allowing users to execute an action that does not properly validate a value before running do_shortcode. This makes it possible for unauthenticated attackers to execute arbitrary shortcodes.
{
"affected": [],
"aliases": [
"CVE-2025-14539"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-12-13T16:16:51Z",
"severity": "MODERATE"
},
"details": "The The Shortcode Ajax plugin for WordPress is vulnerable to arbitrary shortcode execution in all versions up to, and including, 1.0. This is due to the software allowing users to execute an action that does not properly validate a value before running do_shortcode. This makes it possible for unauthenticated attackers to execute arbitrary shortcodes.",
"id": "GHSA-h9xh-g5pc-79x3",
"modified": "2025-12-13T18:30:21Z",
"published": "2025-12-13T18:30:21Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-14539"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/shortcode-ajax/trunk/shortcode-ajax.php#L29"
},
{
"type": "WEB",
"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/8e2a994f-7a42-4ccb-8fa0-77107ba1150c?source=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-HC2F-F465-FW5X
Vulnerability from github – Published: 2022-05-01 18:00 – Updated: 2022-05-01 18:00PHP remote file inclusion vulnerability in blocks/tsdisplay4xoops_block2.php in tsdisplay4xoops (TSD4XOOPS, aka the TeamSpeak display module) 0.1 allows remote attackers to execute arbitrary PHP code via a URL in the xoops_url parameter.
{
"affected": [],
"aliases": [
"CVE-2007-2091"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-04-18T10:19:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in blocks/tsdisplay4xoops_block2.php in tsdisplay4xoops (TSD4XOOPS, aka the TeamSpeak display module) 0.1 allows remote attackers to execute arbitrary PHP code via a URL in the xoops_url parameter.",
"id": "GHSA-hc2f-f465-fw5x",
"modified": "2022-05-01T18:00:04Z",
"published": "2022-05-01T18:00:04Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-2091"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/33695"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/3750"
},
{
"type": "WEB",
"url": "http://osvdb.org/37413"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/23518"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2007/1424"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-HC53-8X9J-FG2X
Vulnerability from github – Published: 2022-05-14 02:36 – Updated: 2025-04-11 03:43The LZW stream decompression functionality in ORMELEMS.DLL in Microsoft Visio 2002 SP2, 2003 SP3, and 2007 SP2 allows remote attackers to execute arbitrary code via a Visio file with a malformed VisioDocument stream that triggers an exception handler that accesses an object that has not been fully initialized, which triggers memory corruption, aka "Visio Object Memory Corruption Vulnerability."
{
"affected": [],
"aliases": [
"CVE-2011-0092"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2011-02-10T16:00:00Z",
"severity": "HIGH"
},
"details": "The LZW stream decompression functionality in ORMELEMS.DLL in Microsoft Visio 2002 SP2, 2003 SP3, and 2007 SP2 allows remote attackers to execute arbitrary code via a Visio file with a malformed VisioDocument stream that triggers an exception handler that accesses an object that has not been fully initialized, which triggers memory corruption, aka \"Visio Object Memory Corruption Vulnerability.\"",
"id": "GHSA-hc53-8x9j-fg2x",
"modified": "2025-04-11T03:43:52Z",
"published": "2022-05-14T02:36:07Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2011-0092"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2011/ms11-008"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/64923"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A12403"
},
{
"type": "WEB",
"url": "http://osvdb.org/70828"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/43254"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/516274/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/46137"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id?1025043"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2011/0321"
},
{
"type": "WEB",
"url": "http://www.zerodayinitiative.com/advisories/ZDI-11-063"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-HC63-FV38-P9MV
Vulnerability from github – Published: 2022-05-24 17:18 – Updated: 2022-05-24 17:18Studio in Open edX Ironwood 2.5, when CodeJail is not used, allows a user to go to the "Create New course>New section>New subsection>New unit>Add new component>Problem button>Advanced tab>Custom Python evaluated code" screen, edit the problem, and execute Python code. This leads to arbitrary code execution.
{
"affected": [],
"aliases": [
"CVE-2020-13144"
],
"database_specific": {
"cwe_ids": [
"CWE-20",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2020-05-18T19:15:00Z",
"severity": "MODERATE"
},
"details": "Studio in Open edX Ironwood 2.5, when CodeJail is not used, allows a user to go to the \"Create New course\u003eNew section\u003eNew subsection\u003eNew unit\u003eAdd new component\u003eProblem button\u003eAdvanced tab\u003eCustom Python evaluated code\" screen, edit the problem, and execute Python code. This leads to arbitrary code execution.",
"id": "GHSA-hc63-fv38-p9mv",
"modified": "2022-05-24T17:18:05Z",
"published": "2022-05-24T17:18:05Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-13144"
},
{
"type": "WEB",
"url": "https://edx.readthedocs.io/projects/edx-developer-guide/en/latest/architecture.html"
},
{
"type": "WEB",
"url": "https://stark0de.com/2020/05/17/openedx-vulnerabilities.html"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.com/files/157785/OpenEDX-Ironwood-2.5-Remote-Code-Execution.html"
}
],
"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-HC8G-CHPW-24WX
Vulnerability from github – Published: 2022-05-17 01:54 – Updated: 2022-05-17 01:54foomaticrip.c in foomatic-rip in foomatic-filters in Foomatic 4.0.6 allows remote attackers to execute arbitrary code via a crafted *FoomaticRIPCommandLine field in a .ppd file, a different vulnerability than CVE-2011-2697.
{
"affected": [],
"aliases": [
"CVE-2011-2964"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2011-07-29T20:55:00Z",
"severity": "MODERATE"
},
"details": "foomaticrip.c in foomatic-rip in foomatic-filters in Foomatic 4.0.6 allows remote attackers to execute arbitrary code via a crafted *FoomaticRIPCommandLine field in a .ppd file, a different vulnerability than CVE-2011-2697.",
"id": "GHSA-hc8g-chpw-24wx",
"modified": "2022-05-17T01:54:08Z",
"published": "2022-05-17T01:54:08Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2011-2964"
},
{
"type": "WEB",
"url": "https://bugzilla.novell.com/show_bug.cgi?id=698451"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=721001"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/68994"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/45477"
},
{
"type": "WEB",
"url": "http://security.gentoo.org/glsa/glsa-201203-07.xml"
},
{
"type": "WEB",
"url": "http://www.mandriva.com/security/advisories?name=MDVSA-2011:125"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2011/07/13/3"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2011/07/18/3"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2011/07/28/1"
},
{
"type": "WEB",
"url": "http://www.redhat.com/support/errata/RHSA-2011-1110.html"
},
{
"type": "WEB",
"url": "http://www.ubuntu.com/usn/USN-1194-1"
},
{
"type": "WEB",
"url": "http://www.xerox.com/download/security/security-bulletin/16287-4d6b7b0c81f7b/cert_XRX13-003_v1.0.pdf"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-HC98-XXM8-JFGJ
Vulnerability from github – Published: 2025-12-15 18:30 – Updated: 2025-12-16 21:30An SSTI (Server-Side Template Injection) vulnerability exists in the get_contract_template method of Frappe ERPNext through 15.89.0. The function renders attacker-controlled Jinja2 templates (contract_terms) using frappe.render_template() with a user-supplied context (doc). Although Frappe uses a custom SandboxedEnvironment, several dangerous globals such as frappe.db.sql are still available in the execution context via get_safe_globals(). An authenticated attacker with access to create or modify a Contract Template can inject arbitrary Jinja expressions into the contract_terms field, resulting in server-side code execution within a restricted but still unsafe context. This vulnerability can be used to leak database information.
{
"affected": [],
"aliases": [
"CVE-2025-66435"
],
"database_specific": {
"cwe_ids": [
"CWE-1336",
"CWE-918",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-12-15T17:15:53Z",
"severity": "MODERATE"
},
"details": "An SSTI (Server-Side Template Injection) vulnerability exists in the get_contract_template method of Frappe ERPNext through 15.89.0. The function renders attacker-controlled Jinja2 templates (contract_terms) using frappe.render_template() with a user-supplied context (doc). Although Frappe uses a custom SandboxedEnvironment, several dangerous globals such as frappe.db.sql are still available in the execution context via get_safe_globals(). An authenticated attacker with access to create or modify a Contract Template can inject arbitrary Jinja expressions into the contract_terms field, resulting in server-side code execution within a restricted but still unsafe context. This vulnerability can be used to leak database information.",
"id": "GHSA-hc98-xxm8-jfgj",
"modified": "2025-12-16T21:30:52Z",
"published": "2025-12-15T18:30:40Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-66435"
},
{
"type": "WEB",
"url": "https://iamanc.github.io/post/erpnext-ssti-bug-2"
},
{
"type": "WEB",
"url": "https://www.notion.so/SSTI-bug-2-239e6086eadc80878e8fcc7b6c26a584?source=copy_link"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N",
"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.