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.
8262 vulnerabilities reference this CWE, most recent first.
GHSA-GGM4-24QQ-F737
Vulnerability from github – Published: 2022-05-04 00:29 – Updated: 2022-05-04 00:29The web interface on Cisco SRP 520 series devices with firmware before 1.1.26 and SRP 520W-U and 540 series devices with firmware before 1.2.4 allows remote authenticated users to execute arbitrary commands via unspecified vectors, related to a "command injection vulnerability," aka Bug ID CSCtt46871.
{
"affected": [],
"aliases": [
"CVE-2012-0363"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2012-02-25T04:21:00Z",
"severity": "HIGH"
},
"details": "The web interface on Cisco SRP 520 series devices with firmware before 1.1.26 and SRP 520W-U and 540 series devices with firmware before 1.2.4 allows remote authenticated users to execute arbitrary commands via unspecified vectors, related to a \"command injection vulnerability,\" aka Bug ID CSCtt46871.",
"id": "GHSA-ggm4-24qq-f737",
"modified": "2022-05-04T00:29:40Z",
"published": "2022-05-04T00:29:40Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2012-0363"
},
{
"type": "WEB",
"url": "http://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20120223-srp500"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id?1026736"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-GGMR-44CV-24PM
Vulnerability from github – Published: 2021-12-09 18:35 – Updated: 2024-10-25 14:50Impact
Sockeye uses YAML to store model and data configurations on disk. Versions below 2.3.24 use unsafe YAML loading, which can be made to execute arbitrary code embedded in config files.
An attacker can add malicious code to the config file of a trained model and attempt to convince users to download and run it. If users run the model, the embedded code will run locally.
Patches
The issue is fixed in version 2.3.24 and above by #964.
For more information
If you have any questions or comments about this advisory: * Open an issue in awslabs/sockeye * Email us at sockeye-dev
Attribution
This vulnerability was reported by Masatoshi Yoshizawa of yamory Security Team.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "sockeye"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.3.24"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-43811"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2021-12-08T23:14:41Z",
"nvd_published_at": "2021-12-08T23:15:00Z",
"severity": "HIGH"
},
"details": "### Impact\nSockeye uses YAML to store model and data configurations on disk. Versions below 2.3.24 use unsafe YAML loading, which can be made to execute arbitrary code embedded in config files.\n\nAn attacker can add malicious code to the config file of a trained model and attempt to convince users to download and run it. If users run the model, the embedded code will run locally.\n\n### Patches\nThe issue is fixed in version 2.3.24 and above by #964.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [awslabs/sockeye](https://github.com/awslabs/sockeye)\n* Email us at [sockeye-dev](mailto:sockeye-dev@amazon.com)\n\n### Attribution\nThis vulnerability was reported by Masatoshi Yoshizawa of yamory Security Team.",
"id": "GHSA-ggmr-44cv-24pm",
"modified": "2024-10-25T14:50:22Z",
"published": "2021-12-09T18:35:22Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/awslabs/sockeye/security/advisories/GHSA-ggmr-44cv-24pm"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-43811"
},
{
"type": "WEB",
"url": "https://github.com/awslabs/sockeye/pull/964"
},
{
"type": "PACKAGE",
"url": "https://github.com/awslabs/sockeye"
},
{
"type": "WEB",
"url": "https://github.com/awslabs/sockeye/releases/tag/2.3.24"
},
{
"type": "WEB",
"url": "https://github.com/pypa/advisory-database/tree/main/vulns/sockeye/PYSEC-2021-848.yaml"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Code injection via unsafe YAML loading"
}
GHSA-GGR9-GQ8G-J6C3
Vulnerability from github – Published: 2022-05-01 23:30 – Updated: 2022-05-01 23:30PHP remote file inclusion vulnerability in theme/phpAutoVideo/LightTwoOh/sidebar.php in Agares phpAutoVideo 2.21 and earlier allows remote attackers to execute arbitrary PHP code via a URL in the loadpage parameter, a different vector than CVE-2007-6614.
{
"affected": [],
"aliases": [
"CVE-2008-0433"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-01-23T22:00:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in theme/phpAutoVideo/LightTwoOh/sidebar.php in Agares phpAutoVideo 2.21 and earlier allows remote attackers to execute arbitrary PHP code via a URL in the loadpage parameter, a different vector than CVE-2007-6614.",
"id": "GHSA-ggr9-gq8g-j6c3",
"modified": "2022-05-01T23:30:14Z",
"published": "2022-05-01T23:30:14Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-0433"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/39770"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/28580"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/3567"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/486591/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/27346"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2008/0225"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-GGVM-GVH9-PJGW
Vulnerability from github – Published: 2022-05-17 01:30 – Updated: 2025-04-12 12:33The setCookieValue function in _lib/functions.global.inc.php in LiveZilla before 5.1.2.1 allows remote attackers to execute arbitrary PHP code via a serialized PHP object in a cookie.
{
"affected": [],
"aliases": [
"CVE-2013-7034"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2014-05-05T17:06:00Z",
"severity": "HIGH"
},
"details": "The setCookieValue function in _lib/functions.global.inc.php in LiveZilla before 5.1.2.1 allows remote attackers to execute arbitrary PHP code via a serialized PHP object in a cookie.",
"id": "GHSA-ggvm-gvh9-pjgw",
"modified": "2025-04-12T12:33:22Z",
"published": "2022-05-17T01:30:03Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2013-7034"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/89796"
},
{
"type": "WEB",
"url": "http://archives.neohapsis.com/archives/bugtraq/2013-12/0078.html"
},
{
"type": "WEB",
"url": "http://forums.livezilla.net/index.php?/topic/163-livezilla-changelog"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/64383"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-GGX2-877F-X836
Vulnerability from github – Published: 2022-05-14 02:35 – Updated: 2022-05-14 02:35Microsoft PowerPoint 2007 SP2; Office 2008 for Mac; Office Compatibility Pack for Word, Excel, and PowerPoint 2007 File Formats SP2; and PowerPoint Viewer 2007 SP2 allow remote attackers to execute arbitrary code or cause a denial of service (memory corruption) via an invalid OfficeArt record in a PowerPoint document, aka "OfficeArt Shape RCE Vulnerability."
{
"affected": [],
"aliases": [
"CVE-2011-3413"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2011-12-14T00:55:00Z",
"severity": "HIGH"
},
"details": "Microsoft PowerPoint 2007 SP2; Office 2008 for Mac; Office Compatibility Pack for Word, Excel, and PowerPoint 2007 File Formats SP2; and PowerPoint Viewer 2007 SP2 allow remote attackers to execute arbitrary code or cause a denial of service (memory corruption) via an invalid OfficeArt record in a PowerPoint document, aka \"OfficeArt Shape RCE Vulnerability.\"",
"id": "GHSA-ggx2-877f-x836",
"modified": "2022-05-14T02:35:30Z",
"published": "2022-05-14T02:35:30Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2011-3413"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2011/ms11-094"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A14581"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/cas/techalerts/TA11-347A.html"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-GGXQ-2MG9-8966
Vulnerability from github – Published: 2026-02-21 06:30 – Updated: 2026-02-25 15:52A flaw was identified in Moodle’s backup restore functionality where specially crafted backup files were not properly validated during processing. If a malicious backup file is restored, it could lead to unintended execution of server-side code. Since restore capabilities are typically available to privileged users, exploitation requires authenticated access. Successful exploitation could result in full compromise of the Moodle server.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "moodle/moodle"
},
"ranges": [
{
"events": [
{
"introduced": "5.1.0-beta"
},
{
"fixed": "5.1.2"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "moodle/moodle"
},
"ranges": [
{
"events": [
{
"introduced": "5.0.0-beta"
},
{
"fixed": "5.0.5"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "moodle/moodle"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "4.5.9"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-26045"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-02-25T15:52:47Z",
"nvd_published_at": "2026-02-21T06:16:58Z",
"severity": "HIGH"
},
"details": "A flaw was identified in Moodle\u2019s backup restore functionality where specially crafted backup files were not properly validated during processing. If a malicious backup file is restored, it could lead to unintended execution of server-side code. Since restore capabilities are typically available to privileged users, exploitation requires authenticated access. Successful exploitation could result in full compromise of the Moodle server.",
"id": "GHSA-ggxq-2mg9-8966",
"modified": "2026-02-25T15:52:47Z",
"published": "2026-02-21T06:30:16Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-26045"
},
{
"type": "WEB",
"url": "https://github.com/moodle/moodle/commit/566054ba11f609a6d48d09b32e85d435d49927da"
},
{
"type": "WEB",
"url": "https://access.redhat.com/security/cve/CVE-2026-26045"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2440901"
},
{
"type": "PACKAGE",
"url": "https://github.com/moodle/moodle"
},
{
"type": "WEB",
"url": "https://moodle.org/mod/forum/discuss.php?d=473314"
}
],
"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": "Moodle has a Remote Code Execution risk via file restore"
}
GHSA-GH27-38P5-MRXC
Vulnerability from github – Published: 2022-05-13 01:02 – Updated: 2022-06-29 22:43In Apache Kafka 0.9.0.0 to 0.9.0.1, 0.10.0.0 to 0.10.2.1, 0.11.0.0 to 0.11.0.2, and 1.0.0, authenticated Kafka users may perform action reserved for the Broker via a manually created fetch request interfering with data replication, resulting in data loss.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 0.10.2.1"
},
"package": {
"ecosystem": "Maven",
"name": "org.apache.kafka:kafka"
},
"ranges": [
{
"events": [
{
"introduced": "0.9.0.0"
},
{
"fixed": "0.10.2.2"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 0.11.0.2"
},
"package": {
"ecosystem": "Maven",
"name": "org.apache.kafka:kafka"
},
"ranges": [
{
"events": [
{
"introduced": "0.11.0.0"
},
{
"fixed": "0.11.0.3"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.apache.kafka:kafka"
},
"ranges": [
{
"events": [
{
"introduced": "1.0.0"
},
{
"fixed": "1.0.1"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"1.0.0"
]
}
],
"aliases": [
"CVE-2018-1288"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2022-06-29T22:43:46Z",
"nvd_published_at": "2018-07-26T14:29:00Z",
"severity": "MODERATE"
},
"details": "In Apache Kafka 0.9.0.0 to 0.9.0.1, 0.10.0.0 to 0.10.2.1, 0.11.0.0 to 0.11.0.2, and 1.0.0, authenticated Kafka users may perform action reserved for the Broker via a manually created fetch request interfering with data replication, resulting in data loss.",
"id": "GHSA-gh27-38p5-mrxc",
"modified": "2022-06-29T22:43:46Z",
"published": "2022-05-13T01:02:18Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-1288"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2018:3768"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread.html/29f61337323f48c47d4b41d74b9e452bd60e65d0e5103af9a6bb2fef@%3Cusers.kafka.apache.org%3E"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread.html/519eb0fd45642dcecd9ff74cb3e71c20a4753f7d82e2f07864b5108f@%3Cdev.drill.apache.org%3E"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread.html/b0656d359c7d40ec9f39c8cc61bca66802ef9a2a12ee199f5b0c1442@%3Cdev.drill.apache.org%3E"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread.html/d1581fb6464c9bec8a72575c01f5097d68e2fbb230aff24622622a58@%3Ccommits.kafka.apache.org%3E"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread.html/f9bc3e55f4e28d1dcd1a69aae6d53e609a758e34d2869b4d798e13cc@%3Cissues.drill.apache.org%3E"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread.html/r07e1bbd1643847d599feb34c707906a4fdcc81e3a6ab01a10c451d40@%3Cissues.flink.apache.org%3E"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread.html/r35322aec467ddae34002690edaa4d9f16e7df9b5bf7164869b75b62c@%3Cdev.kafka.apache.org%3E"
},
{
"type": "WEB",
"url": "https://www.oracle.com/security-alerts/cpujul2020.html"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/104900"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L",
"type": "CVSS_V3"
}
],
"summary": "Improper Control of Generation of Code in Apache Kafka"
}
GHSA-GH38-X2WM-XMC8
Vulnerability from github – Published: 2022-01-28 22:13 – Updated: 2022-01-31 21:45Groovy Code Injection & SpEL Injection which lead to Remote Code Execution. This issue affected Apache ShenYu 2.4.0 and 2.4.1.
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "org.apache.shenyu:shenyu-common"
},
"ranges": [
{
"events": [
{
"introduced": "2.4.0"
},
{
"fixed": "2.4.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-45029"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2022-01-26T22:40:21Z",
"nvd_published_at": "2022-01-25T13:15:00Z",
"severity": "CRITICAL"
},
"details": "Groovy Code Injection \u0026 SpEL Injection which lead to Remote Code Execution. This issue affected Apache ShenYu 2.4.0 and 2.4.1.",
"id": "GHSA-gh38-x2wm-xmc8",
"modified": "2022-01-31T21:45:30Z",
"published": "2022-01-28T22:13:27Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-45029"
},
{
"type": "WEB",
"url": "https://github.com/apache/incubator-shenyu"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread/3zzmwvg3012tg306x8o893fvdcssx639"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2022/01/25/8"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2022/01/26/1"
}
],
"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": "Code injection in ShenYu"
}
GHSA-GH4H-9FQH-2R9H
Vulnerability from github – Published: 2022-05-01 07:21 – Updated: 2022-05-01 07:21Unspecified vulnerability in certain COM objects in Microsoft Office Web Components 2000 allows user-assisted remote attackers to execute arbitrary code via a crafted URL, aka "Office Web Components URL Parsing Vulnerability."
{
"affected": [],
"aliases": [
"CVE-2006-4695"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2006-12-31T05:00:00Z",
"severity": "HIGH"
},
"details": "Unspecified vulnerability in certain COM objects in Microsoft Office Web Components 2000 allows user-assisted remote attackers to execute arbitrary code via a crafted URL, aka \"Office Web Components URL Parsing Vulnerability.\"",
"id": "GHSA-gh4h-9fqh-2r9h",
"modified": "2022-05-01T07:21:11Z",
"published": "2022-05-01T07:21:11Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-4695"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2008/ms08-017"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A14227"
},
{
"type": "WEB",
"url": "http://marc.info/?l=bugtraq\u0026m=120585858807305\u0026w=2"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/29328"
},
{
"type": "WEB",
"url": "http://www.kb.cert.org/vuls/id/654577"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/28135"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id?1019580"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/cas/techalerts/TA08-071A.html"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2008/0849/references"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-GH84-CHCQ-GGCF
Vulnerability from github – Published: 2022-05-01 17:41 – Updated: 2022-05-01 17:41The MFC component in Microsoft Windows 2000 SP4, XP SP2, and 2003 SP1 and Visual Studio .NET 2000, 2002 SP1, 2003, and 2003 SP1 allows user-assisted remote attackers to execute arbitrary code via an RTF file with a malformed OLE object that triggers memory corruption. NOTE: this might be due to a stack-based buffer overflow in the AfxOleSetEditMenu function in MFC42u.dll.
{
"affected": [],
"aliases": [
"CVE-2007-0025"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-02-13T20:28:00Z",
"severity": "HIGH"
},
"details": "The MFC component in Microsoft Windows 2000 SP4, XP SP2, and 2003 SP1 and Visual Studio .NET 2000, 2002 SP1, 2003, and 2003 SP1 allows user-assisted remote attackers to execute arbitrary code via an RTF file with a malformed OLE object that triggers memory corruption. NOTE: this might be due to a stack-based buffer overflow in the AfxOleSetEditMenu function in MFC42u.dll.",
"id": "GHSA-gh84-chcq-ggcf",
"modified": "2022-05-01T17:41:21Z",
"published": "2022-05-01T17:41:21Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-0025"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2007/ms07-012"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A157"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/24150"
},
{
"type": "WEB",
"url": "http://www.kb.cert.org/vuls/id/932041"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/31887"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/22476"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id?1017638"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/cas/techalerts/TA07-044A.html"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2007/0581"
}
],
"schema_version": "1.4.0",
"severity": []
}
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.