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.
8442 vulnerabilities reference this CWE, most recent first.
GHSA-7CHV-RRW6-W6FC
Vulnerability from github – Published: 2021-05-18 18:36 – Updated: 2025-05-30 00:31Impact
The vulnerability may allow a remote attacker has sufficient rights to execute commands of the host only by manipulating the processed input stream. No user is affected, who followed the recommendation to setup XStream's security framework with a whitelist limited to the minimal required types.
Patches
If you rely on XStream's default blacklist of the Security Framework, you will have to use at least version 1.4.17.
Workarounds
See workarounds for the different versions covering all CVEs.
References
See full information about the nature of the vulnerability and the steps to reproduce it in XStream's documentation for CVE-2021-29505.
Credits
V3geB1rd, white hat hacker from Tencent Security Response Center found and reported the issue to XStream and provided the required information to reproduce it.
For more information
If you have any questions or comments about this advisory: * Open an issue in XStream * Email us at XStream Google Group
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "com.thoughtworks.xstream:xstream"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.4.17"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-29505"
],
"database_specific": {
"cwe_ids": [
"CWE-502",
"CWE-74",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2021-05-18T16:14:15Z",
"nvd_published_at": "2021-05-28T21:15:00Z",
"severity": "HIGH"
},
"details": "### Impact\nThe vulnerability may allow a remote attacker has sufficient rights to execute commands of the host only by manipulating the processed input stream. No user is affected, who followed the recommendation to setup XStream\u0027s security framework with a whitelist limited to the minimal required types.\n\n### Patches\nIf you rely on XStream\u0027s default blacklist of the Security Framework, you will have to use at least version 1.4.17.\n\n### Workarounds\nSee [workarounds](https://x-stream.github.io/security.html#workaround) for the different versions covering all CVEs.\n\n### References\nSee full information about the nature of the vulnerability and the steps to reproduce it in XStream\u0027s documentation for [CVE-2021-29505](https://x-stream.github.io/CVE-2021-29505.html).\n\n### Credits\n\nV3geB1rd, white hat hacker from Tencent Security Response Center found and reported the issue to XStream and provided the required information to reproduce it.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [XStream](https://github.com/x-stream/xstream/issues)\n* Email us at [XStream Google Group](https://groups.google.com/group/xstream-user)",
"id": "GHSA-7chv-rrw6-w6fc",
"modified": "2025-05-30T00:31:13Z",
"published": "2021-05-18T18:36:27Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/x-stream/xstream/security/advisories/GHSA-7chv-rrw6-w6fc"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-29505"
},
{
"type": "WEB",
"url": "https://github.com/x-stream/xstream/commit/24fac82191292c6ae25f94508d28b9823f83624f"
},
{
"type": "WEB",
"url": "https://github.com/x-stream/xstream/commit/f0c4a8d861b68ffc3119cfbbbd632deee624e227"
},
{
"type": "WEB",
"url": "https://x-stream.github.io/CVE-2021-29505.html"
},
{
"type": "WEB",
"url": "https://www.oracle.com/security-alerts/cpuoct2021.html"
},
{
"type": "WEB",
"url": "https://www.oracle.com/security-alerts/cpujul2022.html"
},
{
"type": "WEB",
"url": "https://www.oracle.com/security-alerts/cpujan2022.html"
},
{
"type": "WEB",
"url": "https://www.oracle.com/security-alerts/cpuapr2022.html"
},
{
"type": "WEB",
"url": "https://www.debian.org/security/2021/dsa-5004"
},
{
"type": "WEB",
"url": "https://security.netapp.com/advisory/ntap-20210708-0007"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QGXIU3YDPG6OGTDHMBLAFN7BPBERXREB"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PVPHZA7VW2RRSDCOIPP2W6O5ND254TU7"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/22KVR6B5IZP3BGQ3HPWIO2FWWCKT3DHP"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QGXIU3YDPG6OGTDHMBLAFN7BPBERXREB"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/PVPHZA7VW2RRSDCOIPP2W6O5ND254TU7"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/22KVR6B5IZP3BGQ3HPWIO2FWWCKT3DHP"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2021/07/msg00004.html"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread.html/r8ee51debf7fd184b6a6b020dc31df25118b0aa612885f12fbe77f04f@%3Cdev.jmeter.apache.org%3E"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread.html/r8ee51debf7fd184b6a6b020dc31df25118b0aa612885f12fbe77f04f%40%3Cdev.jmeter.apache.org%3E"
},
{
"type": "PACKAGE",
"url": "https://github.com/x-stream/xstream"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "XStream is vulnerable to a Remote Command Execution attack"
}
GHSA-7CJ6-FGFF-X749
Vulnerability from github – Published: 2022-05-14 04:00 – Updated: 2025-04-11 03:56Opera before 11.62 allows user-assisted remote attackers to trick users into downloading and executing arbitrary files via a small window for the download dialog.
{
"affected": [],
"aliases": [
"CVE-2012-1924"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2012-03-28T03:22:00Z",
"severity": "MODERATE"
},
"details": "Opera before 11.62 allows user-assisted remote attackers to trick users into downloading and executing arbitrary files via a small window for the download dialog.",
"id": "GHSA-7cj6-fgff-x749",
"modified": "2025-04-11T03:56:32Z",
"published": "2022-05-14T04:00:10Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2012-1924"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/74349"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-security-announce/2012-05/msg00012.html"
},
{
"type": "WEB",
"url": "http://osvdb.org/80620"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/48535"
},
{
"type": "WEB",
"url": "http://www.opera.com/docs/changelogs/mac/1162"
},
{
"type": "WEB",
"url": "http://www.opera.com/docs/changelogs/unix/1162"
},
{
"type": "WEB",
"url": "http://www.opera.com/docs/changelogs/windows/1162"
},
{
"type": "WEB",
"url": "http://www.opera.com/support/kb/view/1010"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-7CM4-VMF2-8WF2
Vulnerability from github – Published: 2022-10-12 19:00 – Updated: 2022-10-18 03:10Dolibarr ERP & CRM <=15.0.3 are vulnerable to Eval injection. By default, any administrator can be added to the installation page of dolibarr, and if successfully added, malicious code can be inserted into the database and then execute it by eval.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "dolibarr/dolibarr"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "15.0.3"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2022-40871"
],
"database_specific": {
"cwe_ids": [
"CWE-94",
"CWE-95"
],
"github_reviewed": true,
"github_reviewed_at": "2022-10-12T20:16:03Z",
"nvd_published_at": "2022-10-12T12:15:00Z",
"severity": "CRITICAL"
},
"details": "Dolibarr ERP \u0026 CRM \u003c=15.0.3 are vulnerable to Eval injection. By default, any administrator can be added to the installation page of dolibarr, and if successfully added, malicious code can be inserted into the database and then execute it by eval.",
"id": "GHSA-7cm4-vmf2-8wf2",
"modified": "2022-10-18T03:10:44Z",
"published": "2022-10-12T19:00:42Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-40871"
},
{
"type": "PACKAGE",
"url": "https://github.com/Dolibarr/dolibarr"
},
{
"type": "WEB",
"url": "https://github.com/youncyb/dolibarr-rce"
}
],
"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": "Dolibarr vulnerable to Eval Injection"
}
GHSA-7CM5-R93J-VF54
Vulnerability from github – Published: 2022-05-02 03:52 – Updated: 2022-05-02 03:52PHP remote file inclusion vulnerability in includes/classes/pctemplate.php in PointComma 3.8b2 and earlier allows remote attackers to execute arbitrary PHP code via a URL in the pcConfig[smartyPath] parameter.
{
"affected": [],
"aliases": [
"CVE-2009-4220"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-12-07T17:30:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in includes/classes/pctemplate.php in PointComma 3.8b2 and earlier allows remote attackers to execute arbitrary PHP code via a URL in the pcConfig[smartyPath] parameter.",
"id": "GHSA-7cm5-r93j-vf54",
"modified": "2022-05-02T03:52:46Z",
"published": "2022-05-02T03:52:46Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-4220"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/54389"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.org/0911-exploits/pointcomma-rfi.txt"
},
{
"type": "WEB",
"url": "http://www.exploit-db.com/exploits/10220"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-7CRH-Q834-JM56
Vulnerability from github – Published: 2025-02-21 18:31 – Updated: 2025-02-21 21:32There is a RCE vulnerability in Tenda AC6 15.03.05.16_multi. In the formexeCommand function, the parameter cmdinput will cause remote command execution.
{
"affected": [],
"aliases": [
"CVE-2025-25507"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-02-21T17:15:14Z",
"severity": "MODERATE"
},
"details": "There is a RCE vulnerability in Tenda AC6 15.03.05.16_multi. In the formexeCommand function, the parameter cmdinput will cause remote command execution.",
"id": "GHSA-7crh-q834-jm56",
"modified": "2025-02-21T21:32:07Z",
"published": "2025-02-21T18:31:14Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-25507"
},
{
"type": "WEB",
"url": "https://github.com/faqiadegege/IoTVuln/blob/main/tendaAC6_formexecommand_cmdinput_rce/detail.md"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-7CW6-7H3H-V8PF
Vulnerability from github – Published: 2026-01-14 16:54 – Updated: 2026-01-14 21:46Impact
We fixed with CVE-2023-2017 Twig filters to only be executed with allowed functions. However there was a regression that lead to an array and array crafted PHP Closure not checked being against allow list for the map(...) override
Patches
Patched in 6.7.6.1
Workarounds
Install the security plugin
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "shopware/shopware"
},
"ranges": [
{
"events": [
{
"introduced": "6.7.0.0"
},
{
"fixed": "6.7.6.1"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "shopware/core"
},
"ranges": [
{
"events": [
{
"introduced": "6.7.0.0"
},
{
"fixed": "6.7.6.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-23498"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-01-14T16:54:27Z",
"nvd_published_at": "2026-01-14T19:16:48Z",
"severity": "HIGH"
},
"details": "### Impact\nWe fixed with [CVE-2023-2017](https://github.com/advisories/GHSA-7v2v-9rm4-7m8f) Twig filters to only be executed with allowed functions. However there was a regression that lead to an array and array crafted PHP Closure not checked being against allow list for the map(...) override\n\n### Patches\nPatched in 6.7.6.1\n\n### Workarounds\nInstall the security plugin",
"id": "GHSA-7cw6-7h3h-v8pf",
"modified": "2026-01-14T21:46:46Z",
"published": "2026-01-14T16:54:27Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/shopware/shopware/security/advisories/GHSA-7cw6-7h3h-v8pf"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-23498"
},
{
"type": "WEB",
"url": "https://github.com/shopware/shopware/commit/3966b05590e29432b8485ba47b4fcd14dd0b8475"
},
{
"type": "ADVISORY",
"url": "https://github.com/advisories/GHSA-7v2v-9rm4-7m8f"
},
{
"type": "PACKAGE",
"url": "https://github.com/shopware/shopware"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Shopware Has Improper Control of Generation of Code in Twig rendered views"
}
GHSA-7CXG-92QX-7WHP
Vulnerability from github – Published: 2022-05-01 07:41 – Updated: 2022-05-01 07:41Multiple PHP remote file inclusion vulnerabilities in template.php in Phpmymanga 0.8.1 and earlier allow remote attackers to execute arbitrary PHP code via a URL in the (1) actionsPage or (2) formPage parameter.
{
"affected": [],
"aliases": [
"CVE-2006-6760"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2006-12-27T01:28:00Z",
"severity": "HIGH"
},
"details": "Multiple PHP remote file inclusion vulnerabilities in template.php in Phpmymanga 0.8.1 and earlier allow remote attackers to execute arbitrary PHP code via a URL in the (1) actionsPage or (2) formPage parameter.",
"id": "GHSA-7cxg-92qx-7whp",
"modified": "2022-05-01T07:41:10Z",
"published": "2022-05-01T07:41:10Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-6760"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/29588"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/2578"
},
{
"type": "WEB",
"url": "http://phpmanga.sourceforge.net/index.php"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/20572"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-7F25-XCVG-54GM
Vulnerability from github – Published: 2022-05-01 06:39 – Updated: 2022-05-01 06:39Unspecified vulnerability in Safari, LaunchServices, and/or CoreTypes in Apple Mac OS X 10.4 up to 10.4.5 allows attackers to trick a user into opening an application that appears to be a safe file type. NOTE: due to the lack of specific information in the vendor advisory, it is not clear how CVE-2006-0397, CVE-2006-0398, and CVE-2006-0399 are different.
{
"affected": [],
"aliases": [
"CVE-2006-0397"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2006-03-14T11:02:00Z",
"severity": "HIGH"
},
"details": "Unspecified vulnerability in Safari, LaunchServices, and/or CoreTypes in Apple Mac OS X 10.4 up to 10.4.5 allows attackers to trick a user into opening an application that appears to be a safe file type. NOTE: due to the lack of specific information in the vendor advisory, it is not clear how CVE-2006-0397, CVE-2006-0398, and CVE-2006-0399 are different.",
"id": "GHSA-7f25-xcvg-54gm",
"modified": "2022-05-01T06:39:32Z",
"published": "2022-05-01T06:39:32Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-0397"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/25269"
},
{
"type": "WEB",
"url": "http://docs.info.apple.com/article.html?artnum=303453"
},
{
"type": "WEB",
"url": "http://lists.apple.com/archives/security-announce/2006/Mar/msg00001.html"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/19129"
},
{
"type": "WEB",
"url": "http://securitytracker.com/id?1015760"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/23869"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2006/0949"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-7F2V-5877-RX3X
Vulnerability from github – Published: 2024-02-17 06:30 – Updated: 2024-04-11 15:51An issue was discovered in REDAXO version 5.15.1, allows attackers to execute arbitrary code and obtain sensitive information via modules.modules.php.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "redaxo/source"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "5.15.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-25298"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2024-02-20T23:54:58Z",
"nvd_published_at": "2024-02-17T06:15:54Z",
"severity": "HIGH"
},
"details": "An issue was discovered in REDAXO version 5.15.1, allows attackers to execute arbitrary code and obtain sensitive information via modules.modules.php.",
"id": "GHSA-7f2v-5877-rx3x",
"modified": "2024-04-11T15:51:33Z",
"published": "2024-02-17T06:30:36Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-25298"
},
{
"type": "WEB",
"url": "https://github.com/CpyRe/I-Find-CVE-2024/blob/main/REDAXO%20RCE.md"
},
{
"type": "PACKAGE",
"url": "https://github.com/redaxo/redaxo"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Code injection in REDAXO"
}
GHSA-7F3J-J7JJ-R3VR
Vulnerability from github – Published: 2026-07-24 15:45 – Updated: 2026-07-24 15:45Code Generation Literal Injection in Kiota Python Generator Leads to Arbitrary Code Execution at Import Time.
The Kiota Python code generator is vulnerable to a code generation literal injection issue when processing malicious or untrusted OpenAPI specifications. Specifically, attacker-controlled enum value descriptions from x-ms-enum.values[].description can flow into generated Python files without newline sanitization, allowing injected content to escape a comment context and execute at module scope when the generated module is imported.
This issue requires user interaction in the form of generating a client from a malicious specification and importing the generated code, which is a common development and CI workflow.
Impact
A malicious OpenAPI specification can cause arbitrary Python code to be emitted into generated model files. The payload executes when the affected module is imported.
Potential impact includes
Credential theft from developer or CI environments Exfiltration of environment variables and secrets Source code disclosure Persistence via regenerated backdoored client output Who is impacted Developers generating Python SDKs from external or untrusted OpenAPI specs Teams with CI/CD automation that regenerates clients from remote specification URLs Any environment importing generated Python modules before manual review Vulnerability details Two gaps combine to enable exploitation:
Enum description cleanup gap
In KiotaBuilder.SetEnumOptions, enum option descriptions are assigned to Documentation.DescriptionTemplate without CleanupDescription on this path, allowing control characters such as newlines to propagate.
Python description sanitization gap
PythonConventionService.RemoveInvalidDescriptionCharacters escapes backslashes and triple quotes but did not remove carriage return/newline characters, unlike some other language convention services.
Exploit path
Malicious newline in x-ms-enum description is emitted through enum writing path. Generated inline comment output is split by newline. Subsequent attacker-controlled line lands at module scope in generated .py file. Importing the module executes the injected code.
Attack vectors
OpenAPI specifications hosted at attacker-controlled URLs Supply-chain scenarios where third-party specs are consumed automatically CI pipelines that generate and then import or test generated Python clients
Patches
https://github.com/microsoft/kiota/pull/7735
Workarounds
If you cannot upgrade immediately:
Only generate from trusted, internally controlled OpenAPI specification sources. Disable or gate automatic generation from remote specs in CI/CD. Add validation/sanitization for x-ms-enum descriptions before generation. Review generated Python files for suspicious top-level statements near enum/model declarations. Run generation and validation in isolated environments without access to production secrets.
Remediation
Upgrade to Kiota 1.32.0 or later.
Regenerate existing Python clients to replace previously generated vulnerable output.
Recommended validation after upgrade
Regenerate from the same spec used in proof-of-concept testing Confirm malicious multi-line enum descriptions no longer produce executable top-level output
{
"affected": [
{
"package": {
"ecosystem": "NuGet",
"name": "Microsoft.OpenAPI.Kiota"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.32.0"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "NuGet",
"name": "Microsoft.OpenAPI.Kiota.Builder"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.32.0"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "NuGet",
"name": "Microsoft.OpenApi.Kiota"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.32.0"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "NuGet",
"name": "Microsoft.OpenApi.Kiota.Builder"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.32.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-59862"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-24T15:45:40Z",
"nvd_published_at": "2026-07-16T15:16:35Z",
"severity": "HIGH"
},
"details": "Code Generation Literal Injection in Kiota Python Generator Leads to Arbitrary Code Execution at Import Time.\n\nThe Kiota Python code generator is vulnerable to a code generation literal injection issue when processing malicious or untrusted OpenAPI specifications. Specifically, attacker-controlled enum value descriptions from x-ms-enum.values[].description can flow into generated Python files without newline sanitization, allowing injected content to escape a comment context and execute at module scope when the generated module is imported.\n\nThis issue requires user interaction in the form of generating a client from a malicious specification and importing the generated code, which is a common development and CI workflow.\n\n# Impact\n\nA malicious OpenAPI specification can cause arbitrary Python code to be emitted into generated model files. The payload executes when the affected module is imported.\n\n## Potential impact includes\n\nCredential theft from developer or CI environments\nExfiltration of environment variables and secrets\nSource code disclosure\nPersistence via regenerated backdoored client output\nWho is impacted\nDevelopers generating Python SDKs from external or untrusted OpenAPI specs\nTeams with CI/CD automation that regenerates clients from remote specification URLs\nAny environment importing generated Python modules before manual review\nVulnerability details\nTwo gaps combine to enable exploitation:\n\n### Enum description cleanup gap\n\nIn KiotaBuilder.SetEnumOptions, enum option descriptions are assigned to Documentation.DescriptionTemplate without CleanupDescription on this path, allowing control characters such as newlines to propagate.\n\n### Python description sanitization gap\n\nPythonConventionService.RemoveInvalidDescriptionCharacters escapes backslashes and triple quotes but did not remove carriage return/newline characters, unlike some other language convention services.\n\n# Exploit path\n\nMalicious newline in x-ms-enum description is emitted through enum writing path.\nGenerated inline comment output is split by newline.\nSubsequent attacker-controlled line lands at module scope in generated .py file.\nImporting the module executes the injected code.\n\n# Attack vectors\n\nOpenAPI specifications hosted at attacker-controlled URLs\nSupply-chain scenarios where third-party specs are consumed automatically\nCI pipelines that generate and then import or test generated Python clients\n\n# Patches\n\nhttps://github.com/microsoft/kiota/pull/7735\n\n# Workarounds\n\nIf you cannot upgrade immediately:\n\nOnly generate from trusted, internally controlled OpenAPI specification sources.\nDisable or gate automatic generation from remote specs in CI/CD.\nAdd validation/sanitization for x-ms-enum descriptions before generation.\nReview generated Python files for suspicious top-level statements near enum/model declarations.\nRun generation and validation in isolated environments without access to production secrets.\n\n# Remediation\n\nUpgrade to Kiota 1.32.0 or later.\n\nRegenerate existing Python clients to replace previously generated vulnerable output.\n\n# Recommended validation after upgrade\n\nRegenerate from the same spec used in proof-of-concept testing\nConfirm malicious multi-line enum descriptions no longer produce executable top-level output",
"id": "GHSA-7f3j-j7jj-r3vr",
"modified": "2026-07-24T15:45:40Z",
"published": "2026-07-24T15:45:40Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/microsoft/kiota/security/advisories/GHSA-7f3j-j7jj-r3vr"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-59862"
},
{
"type": "PACKAGE",
"url": "https://github.com/microsoft/kiota"
},
{
"type": "WEB",
"url": "https://github.com/microsoft/kiota/releases/tag/v1.32.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
],
"summary": "Microsoft Kiota: Code Generation Literal Injection in Kiota Python Generator"
}
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.