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.
8376 vulnerabilities reference this CWE, most recent first.
GHSA-PQFC-759Q-J9JG
Vulnerability from github – Published: 2022-05-01 23:29 – Updated: 2022-05-01 23:29stat.php in AuraCMS 1.62, and Mod Block Statistik for AuraCMS, allows remote attackers to inject arbitrary PHP code into online.db.txt via the X-Forwarded-For HTTP header in a stat action to index.php, and execute online.db.txt via a certain request to index.php.
{
"affected": [],
"aliases": [
"CVE-2008-0390"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-01-23T02:00:00Z",
"severity": "HIGH"
},
"details": "stat.php in AuraCMS 1.62, and Mod Block Statistik for AuraCMS, allows remote attackers to inject arbitrary PHP code into online.db.txt via the X-Forwarded-For HTTP header in a stat action to index.php, and execute online.db.txt via a certain request to index.php.",
"id": "GHSA-pqfc-759q-j9jg",
"modified": "2022-05-01T23:29:49Z",
"published": "2022-05-01T23:29:49Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-0390"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/39777"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/4933"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/27342"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-PQHX-W72W-M393
Vulnerability from github – Published: 2026-04-23 18:33 – Updated: 2026-05-08 16:32An issue in Ntfy ntfy.sh before v.2.22.0 allows a remote attacker to execute arbitrary code via the parseActions function.
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "heckel.io/ntfy/v2"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.22.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-39087"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-05-08T16:32:46Z",
"nvd_published_at": "2026-04-23T16:16:25Z",
"severity": "CRITICAL"
},
"details": "An issue in Ntfy ntfy.sh before v.2.22.0 allows a remote attacker to execute arbitrary code via the parseActions function.",
"id": "GHSA-pqhx-w72w-m393",
"modified": "2026-05-08T16:32:47Z",
"published": "2026-04-23T18:33:03Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-39087"
},
{
"type": "WEB",
"url": "https://gist.github.com/MightyNawaf/5d41d6e8ead16e217f86b016002ecae5"
},
{
"type": "PACKAGE",
"url": "https://github.com/binwiederhier/ntfy"
},
{
"type": "WEB",
"url": "https://github.com/binwiederhier/ntfy/releases/tag/v2.22.0"
},
{
"type": "WEB",
"url": "http://ntfy.com"
},
{
"type": "WEB",
"url": "http://ntfysh.com"
}
],
"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": "ntfy.sh allows a remote attacker to execute arbitrary code via the parseActions function"
}
GHSA-PQJM-XCP8-WGMM
Vulnerability from github – Published: 2024-05-15 21:31 – Updated: 2024-05-15 21:31The eZ Platform and Legacy are affected by an issue related to how uploaded PHP and PHAR files are handled, and consists of two parts: 1. Web server configuration, and 2. Disabling the PHAR stream wrapper.
1. WEB SERVER CONFIGURATION The sample web server configuration in our documentation can in some cases allow the execution of uploaded PHP/PHAR code. This can be abused to allow priviledge escalation and breach of content access controls, among other things. Please ensure that your web server will not execute files in directories were files may be uploaded, such as web/var/ and ezpublish_legacy/var/
As an example, here is how you can make Apache return HTTP 403 Forbidden for a number of executable file types in your eZ Platform var directory. Please adapt it to your needs. It is then possible to enable logging of HTTP 403 in a separate log file if you wish, you could do this to see if someone is trying to abuse the server.
RewriteEngine On
# disable .php(3) and other extensions in the var directory
RewriteRule ^var/.*(?i)\.(php3?|phar|phtml|sh|exe|pl|bin)$ - [F]
Here is the same configuration, but for the Nginx web server:
location ~ ^/var/.*(?i)\.(php3?|phar|phtml|sh|exe|pl|bin)$ {
return 403;
}
2. DISABLE PHAR STREAM WRAPPER PHAR archives may be crafted such that its stream wrapper will execute them without being specifically asked to. With such files, any PHP file operation may cause deserialisation and execution. This may happen even if the file name suffix isn't ".phar". Any site that allows file uploads is at risk. Normally eZ Platform has no need for PHAR support. It's only used by Composer, and that is executed separately from eZ Platform. So one way to avoid this vulnerability is to disable the PHAR stream wrapper within eZ Platform. (If you know you need PHAR support, please consider other means to deal with this vulnerability. For example, enabling the wrapper only in those scripts/bundles that have to deal with such files.)
Disabling the stream wrapper should be done in:
eZ Platform (web/app.php) CLI scripts (bin/console) Legacy (index.php and CLI scripts)
To install, use Composer to update to one of the "Resolving versions" mentioned above, or apply these patches manually: https://github.com/ezsystems/ezplatform/commit/9a0c52dc4535e4b3ce379f80222dc53f705a2cfd https://github.com/ezsystems/ezpublish-legacy/commit/d21957bf202b091ab39dfb5be300f6c30be3933e
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "ezsystems/ezpublish-legacy"
},
"ranges": [
{
"events": [
{
"introduced": "2018.9.0"
},
{
"fixed": "2018.9.1.3"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "ezsystems/ezpublish-legacy"
},
"ranges": [
{
"events": [
{
"introduced": "2018.6.0"
},
{
"fixed": "2018.6.1.4"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "ezsystems/ezpublish-legacy"
},
"ranges": [
{
"events": [
{
"introduced": "2011.0.0"
},
{
"fixed": "2017.12.4.3"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "ezsystems/ezpublish-legacy"
},
"ranges": [
{
"events": [
{
"introduced": "5.4.0"
},
{
"fixed": "5.4.12.3"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "ezsystems/ezpublish-legacy"
},
"ranges": [
{
"events": [
{
"introduced": "5.3.0"
},
{
"fixed": "5.3.12.6"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2024-05-15T21:31:07Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "The eZ Platform and Legacy are affected by an issue related to how uploaded PHP and PHAR files are handled, and consists of two parts: 1. Web server configuration, and 2. Disabling the PHAR stream wrapper.\n\n**1. WEB SERVER CONFIGURATION**\nThe sample web server configuration in our documentation can in some cases allow the execution of uploaded PHP/PHAR code. This can be abused to allow priviledge escalation and breach of content access controls, among other things. Please ensure that your web server will not execute files in directories were files may be uploaded, such as web/var/ and ezpublish_legacy/var/\n\nAs an example, here is how you can make Apache return HTTP 403 Forbidden for a number of executable file types in your eZ Platform var directory. Please adapt it to your needs. It is then possible to enable logging of HTTP 403 in a separate log file if you wish, you could do this to see if someone is trying to abuse the server.\n```\nRewriteEngine On\n\n# disable .php(3) and other extensions in the var directory\nRewriteRule ^var/.*(?i)\\.(php3?|phar|phtml|sh|exe|pl|bin)$ - [F]\n```\nHere is the same configuration, but for the Nginx web server:\n```\nlocation ~ ^/var/.*(?i)\\.(php3?|phar|phtml|sh|exe|pl|bin)$ {\n return 403;\n}\n```\n\n**2. DISABLE PHAR STREAM WRAPPER**\nPHAR archives may be crafted such that its stream wrapper will execute them without being specifically asked to. With such files, any PHP file operation may cause deserialisation and execution. This may happen even if the file name suffix isn\u0027t \".phar\". Any site that allows file uploads is at risk. Normally eZ Platform has no need for PHAR support. It\u0027s only used by Composer, and that is executed separately from eZ Platform. So one way to avoid this vulnerability is to disable the PHAR stream wrapper within eZ Platform. (If you know you need PHAR support, please consider other means to deal with this vulnerability. For example, enabling the wrapper only in those scripts/bundles that have to deal with such files.)\n\nDisabling the stream wrapper should be done in:\n\neZ Platform (web/app.php)\nCLI scripts (bin/console)\nLegacy (index.php and CLI scripts)\n\nTo install, use Composer to update to one of the \"Resolving versions\" mentioned above, or apply these patches manually:\nhttps://github.com/ezsystems/ezplatform/commit/9a0c52dc4535e4b3ce379f80222dc53f705a2cfd\nhttps://github.com/ezsystems/ezpublish-legacy/commit/d21957bf202b091ab39dfb5be300f6c30be3933e",
"id": "GHSA-pqjm-xcp8-wgmm",
"modified": "2024-05-15T21:31:07Z",
"published": "2024-05-15T21:31:07Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/ezsystems/ezplatform/commit/9a0c52dc4535e4b3ce379f80222dc53f705a2cfd"
},
{
"type": "WEB",
"url": "https://github.com/ezsystems/ezpublish-legacy/commit/d21957bf202b091ab39dfb5be300f6c30be3933e"
},
{
"type": "WEB",
"url": "https://github.com/FriendsOfPHP/security-advisories/blob/master/ezsystems/ezpublish-legacy/2018-11-21-1.yaml"
},
{
"type": "PACKAGE",
"url": "https://github.com/ezsystems/ezpublish-legacy"
},
{
"type": "WEB",
"url": "https://web.archive.org/web/20210614192208/https://share.ez.no/community-project/security-advisories/ezsa-2018-009-do-not-interpret-php-phar-uploads"
},
{
"type": "WEB",
"url": "http://share.ez.no/community-project/security-advisories/ezsa-2018-009-do-not-interpret-php-phar-uploads"
}
],
"schema_version": "1.4.0",
"severity": [],
"summary": "Ez Platform and Legacy are prone to an insecure interpretation of PHP/PHAR uploads"
}
GHSA-PQP3-HMP8-73FC
Vulnerability from github – Published: 2025-10-30 18:31 – Updated: 2025-10-30 21:30An issue in BusinessNext CRMnext v.10.8.3.0 allows a remote attacker to execute arbitrary code via the comments unput parameter
{
"affected": [],
"aliases": [
"CVE-2025-61196"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-10-30T17:15:39Z",
"severity": "HIGH"
},
"details": "An issue in BusinessNext CRMnext v.10.8.3.0 allows a remote attacker to execute arbitrary code via the comments unput parameter",
"id": "GHSA-pqp3-hmp8-73fc",
"modified": "2025-10-30T21:30:46Z",
"published": "2025-10-30T18:31:11Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-61196"
},
{
"type": "WEB",
"url": "https://github.com/zsamamah/CVE-2025-61196/blob/main/CVE-2025-61196.md"
}
],
"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-PQPR-JC5H-3WJ2
Vulnerability from github – Published: 2022-05-01 07:16 – Updated: 2022-05-01 07:16Multiple PHP remote file inclusion vulnerabilities in Chaussette 080706 and earlier allow remote attackers to execute arbitrary PHP code via a URL in the _BASE parameter to scripts in Classes/ including (1) Evenement.php, (2) Event.php, (3) Event_for_month.php, (4) Event_for_week.php, (5) My_Log.php, (6) My_Smarty.php, and possibly (7) Event_for_month_per_day.php.
{
"affected": [],
"aliases": [
"CVE-2006-4159"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2006-08-16T22:04:00Z",
"severity": "HIGH"
},
"details": "Multiple PHP remote file inclusion vulnerabilities in Chaussette 080706 and earlier allow remote attackers to execute arbitrary PHP code via a URL in the _BASE parameter to scripts in Classes/ including (1) Evenement.php, (2) Event.php, (3) Event_for_month.php, (4) Event_for_week.php, (5) My_Log.php, (6) My_Smarty.php, and possibly (7) Event_for_month_per_day.php.",
"id": "GHSA-pqpr-jc5h-3wj2",
"modified": "2022-05-01T07:16:06Z",
"published": "2022-05-01T07:16:06Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-4159"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/28327"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/2169"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/21489"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/27897"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/27898"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/27899"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/27900"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/27901"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/27902"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/19480"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2006/3269"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-PQRV-4W4W-MGX5
Vulnerability from github – Published: 2022-05-14 01:50 – Updated: 2022-05-14 01:50An issue was discovered in LAOBANCMS 2.0. It allows remote attackers to execute arbitrary PHP code via the host parameter to the install/ URI.
{
"affected": [],
"aliases": [
"CVE-2018-19220"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-11-12T20:29:00Z",
"severity": "CRITICAL"
},
"details": "An issue was discovered in LAOBANCMS 2.0. It allows remote attackers to execute arbitrary PHP code via the host parameter to the install/ URI.",
"id": "GHSA-pqrv-4w4w-mgx5",
"modified": "2022-05-14T01:50:16Z",
"published": "2022-05-14T01:50:16Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-19220"
},
{
"type": "WEB",
"url": "https://github.com/AvaterXXX/laobanCMS/blob/master/1.md#getshell"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-PQV6-CJX7-HMC5
Vulnerability from github – Published: 2024-10-15 09:30 – Updated: 2024-10-15 09:30The The AADMY – Add Auto Date Month Year Into Posts plugin for WordPress is vulnerable to arbitrary shortcode execution in all versions up to, and including, 2.0.1. 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-2024-9837"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-10-15T08:15:02Z",
"severity": "HIGH"
},
"details": "The The AADMY \u2013 Add Auto Date Month Year Into Posts plugin for WordPress is vulnerable to arbitrary shortcode execution in all versions up to, and including, 2.0.1. 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-pqv6-cjx7-hmc5",
"modified": "2024-10-15T09:30:31Z",
"published": "2024-10-15T09:30:31Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-9837"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/auto-date-year-month/trunk/auto-date-year-month.php#L218"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/changeset/3167908"
},
{
"type": "WEB",
"url": "https://wordpress.org/plugins/auto-date-year-month/#developers"
},
{
"type": "WEB",
"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/fb165cba-34a9-42d9-bfd5-31a290d02311?source=cve"
}
],
"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:L",
"type": "CVSS_V3"
}
]
}
GHSA-PQVQ-CGX4-49HV
Vulnerability from github – Published: 2022-05-17 05:20 – Updated: 2022-05-17 05:20PHP remote file inclusion vulnerability in wp_xml_export.php in the BackWPup plugin before 1.7.2 for WordPress allows remote attackers to execute arbitrary PHP code via a URL in the wpabs parameter.
{
"affected": [],
"aliases": [
"CVE-2011-4342"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2012-10-08T18:55:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in wp_xml_export.php in the BackWPup plugin before 1.7.2 for WordPress allows remote attackers to execute arbitrary PHP code via a URL in the wpabs parameter.",
"id": "GHSA-pqvq-cgx4-49hv",
"modified": "2022-05-17T05:20:22Z",
"published": "2022-05-17T05:20:22Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2011-4342"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.org/files/view/99799/SOS-11-003.txt"
},
{
"type": "WEB",
"url": "http://seclists.org/fulldisclosure/2011/Mar/328"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/43565"
},
{
"type": "WEB",
"url": "http://wordpress.org/support/topic/plugin-backwpup-remote-and-local-codeexecution-vulnerability-sos-11-003"
},
{
"type": "WEB",
"url": "http://www.exploit-db.com/exploits/17056"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2011/11/22/10"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2011/11/22/7"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/71481"
},
{
"type": "WEB",
"url": "http://www.senseofsecurity.com.au/advisories/SOS-11-003.pdf"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-PQX5-MP9C-HM3R
Vulnerability from github – Published: 2022-05-24 22:00 – Updated: 2022-05-24 22:00Multiple file upload restriction bypass vulnerabilities in Sentrifugo 3.2 could allow authenticated users to execute arbitrary code via a webshell.
{
"affected": [],
"aliases": [
"CVE-2019-15813"
],
"database_specific": {
"cwe_ids": [
"CWE-434",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2019-09-04T14:15:00Z",
"severity": "HIGH"
},
"details": "Multiple file upload restriction bypass vulnerabilities in Sentrifugo 3.2 could allow authenticated users to execute arbitrary code via a webshell.",
"id": "GHSA-pqx5-mp9c-hm3r",
"modified": "2022-05-24T22:00:24Z",
"published": "2022-05-24T22:00:24Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-15813"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/47323"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.com/files/159712/Sentrifugo-3.2-Shell-Upload-Restriction-Bypass.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-PQXG-66P9-RR3W
Vulnerability from github – Published: 2023-09-05 18:30 – Updated: 2024-04-04 07:29Cuppa CMS v1.0 was discovered to contain a remote code execution (RCE) vulnerability via the email_outgoing parameter at /Configuration.php. This vulnerability is triggered via a crafted payload.
{
"affected": [],
"aliases": [
"CVE-2023-39681"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-09-05T18:15:11Z",
"severity": "CRITICAL"
},
"details": "Cuppa CMS v1.0 was discovered to contain a remote code execution (RCE) vulnerability via the email_outgoing parameter at /Configuration.php. This vulnerability is triggered via a crafted payload.",
"id": "GHSA-pqxg-66p9-rr3w",
"modified": "2024-04-04T07:29:31Z",
"published": "2023-09-05T18:30:23Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-39681"
},
{
"type": "WEB",
"url": "https://github.com/yanbochen97/CuppaCMS_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"
}
]
}
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.