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.
8342 vulnerabilities reference this CWE, most recent first.
GHSA-CJHG-7X4H-7J52
Vulnerability from github – Published: 2024-03-25 15:30 – Updated: 2024-08-01 15:31An issue in Home-Made.io fastmagsync v.1.7.51 and before allows a remote attacker to execute arbitrary code via the getPhpBin() component.
{
"affected": [],
"aliases": [
"CVE-2024-28386"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-03-25T14:15:09Z",
"severity": "CRITICAL"
},
"details": "An issue in Home-Made.io fastmagsync v.1.7.51 and before allows a remote attacker to execute arbitrary code via the getPhpBin() component.",
"id": "GHSA-cjhg-7x4h-7j52",
"modified": "2024-08-01T15:31:34Z",
"published": "2024-03-25T15:30:39Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-28386"
},
{
"type": "WEB",
"url": "https://reference1.example.com/modules/fastmagsync/crons/cron_mutualise_job_queue.php?hosting=.%20%26%20%20echo%20%27%3C%3Fphp%20echo%20%2242ovh%22%3B%27%20%3E%20a.php%3B%23\u0026syncway=tofastmag"
},
{
"type": "WEB",
"url": "https://security.friendsofpresta.org/modules/2024/03/19/fastmagsync.html"
},
{
"type": "WEB",
"url": "https://www.home-made.io/module-fastmag-sync-prestashop"
},
{
"type": "WEB",
"url": "http://fastmagsync.com"
},
{
"type": "WEB",
"url": "http://home-madeio.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"
}
]
}
GHSA-CJJF-27CC-PVMV
Vulnerability from github – Published: 2025-10-09 15:19 – Updated: 2026-04-24 21:09Summary
pyLoad web interface contained insufficient input validation in both the Captcha script endpoint and the Click'N'Load (CNL) Blueprint. This flaw allowed untrusted user input to be processed unsafely, which could be exploited by an attacker to inject arbitrary content into the web UI or manipulate request handling. The vulnerability could lead to client-side code execution (XSS) or other unintended behaviors when a malicious payload is submitted.
user-supplied parameters from HTTP requests were not adequately validated or sanitized before being passed into the application logic and response generation. This allowed crafted input to alter the expected execution flow. CNL (Click'N'Load) blueprint exposed unsafe handling of untrusted parameters in HTTP requests. The application did not consistently enforce input validation or encoding, making it possible for an attacker to craft malicious requests.
PoC
- Run a vulnerable version of pyLoad prior to commit
f9d27f2. - Start the web UI and access the Captcha or CNL endpoints.
- Submit a crafted request containing malicious JavaScript payloads in unvalidated parameters (
/flash/addcrypted2?jk=function(){alert(1)}&crypted=12345). - Observe that the payload is reflected and executed in the client’s browser, demonstrating cross-site scripting (XSS).
Example request:
GET /flash/addcrypted2?jk=function(){alert(1)}&crypted=12345 HTTP/1.1
Host: 127.0.0.1:8000
Content-Type: application/x-www-form-urlencoded
Content-Length: 107
Refferences
- https://github.com/pyload/pyload/commit/5823327d0b797161c7195a1f660266d30a69f0ca
@4624
Impact
Exploiting this vulnerability allows an attacker to inject and execute arbitrary JavaScript within the browser session of a user accessing the pyLoad Web UI. In practice, this means an attacker could impersonate an administrator, steal authentication cookies or tokens, and perform unauthorized actions on behalf of the victim. Because the affected endpoints are part of the core interface, a successful attack undermines the trust and security of the entire application, potentially leading to a full compromise of the management interface and the data it controls. The impact is particularly severe in cases where the Web UI is exposed over a network without additional access restrictions, as it enables remote attackers to directly target users with crafted links or requests that trigger the vulnerability.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "pyload-ng"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.5.0b3.dev91"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-61773"
],
"database_specific": {
"cwe_ids": [
"CWE-116",
"CWE-74",
"CWE-79",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2025-10-09T15:19:48Z",
"nvd_published_at": "2025-10-09T21:15:39Z",
"severity": "HIGH"
},
"details": "### Summary\npyLoad web interface contained insufficient input validation in both the Captcha script endpoint and the Click\u0027N\u0027Load (CNL) Blueprint. This flaw allowed untrusted user input to be processed unsafely, which could be exploited by an attacker to inject arbitrary content into the web UI or manipulate request handling. The vulnerability could lead to client-side code execution (XSS) or other unintended behaviors when a malicious payload is submitted.\n\nuser-supplied parameters from HTTP requests were not adequately validated or sanitized before being passed into the application logic and response generation. This allowed crafted input to alter the expected execution flow.\n CNL (Click\u0027N\u0027Load) blueprint exposed unsafe handling of untrusted parameters in HTTP requests. The application did not consistently enforce input validation or encoding, making it possible for an attacker to craft malicious requests.\n\n### PoC\n\n1. Run a vulnerable version of pyLoad prior to commit [`f9d27f2`](https://github.com/pyload/pyload/pull/4624).\n2. Start the web UI and access the Captcha or CNL endpoints.\n3. Submit a crafted request containing malicious JavaScript payloads in unvalidated parameters (`/flash/addcrypted2?jk=function(){alert(1)}\u0026crypted=12345`).\n4. Observe that the payload is reflected and executed in the client\u2019s browser, demonstrating cross-site scripting (XSS).\n\nExample request:\n\n```http\nGET /flash/addcrypted2?jk=function(){alert(1)}\u0026crypted=12345 HTTP/1.1\nHost: 127.0.0.1:8000\nContent-Type: application/x-www-form-urlencoded\nContent-Length: 107\n```\n\n### Refferences\n- https://github.com/pyload/pyload/commit/5823327d0b797161c7195a1f660266d30a69f0ca\n- [`@4624`](https://github.com/pyload/pyload/pull/4624)\n\n### Impact\n\nExploiting this vulnerability allows an attacker to inject and execute arbitrary JavaScript within the browser session of a user accessing the pyLoad Web UI. In practice, this means an attacker could impersonate an administrator, steal authentication cookies or tokens, and perform unauthorized actions on behalf of the victim. Because the affected endpoints are part of the core interface, a successful attack undermines the trust and security of the entire application, potentially leading to a full compromise of the management interface and the data it controls. The impact is particularly severe in cases where the Web UI is exposed over a network without additional access restrictions, as it enables remote attackers to directly target users with crafted links or requests that trigger the vulnerability.",
"id": "GHSA-cjjf-27cc-pvmv",
"modified": "2026-04-24T21:09:37Z",
"published": "2025-10-09T15:19:48Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/pyload/pyload/security/advisories/GHSA-cjjf-27cc-pvmv"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-61773"
},
{
"type": "WEB",
"url": "https://github.com/pyload/pyload/pull/4624"
},
{
"type": "WEB",
"url": "https://github.com/pyload/pyload/commit/5823327d0b797161c7195a1f660266d30a69f0ca"
},
{
"type": "PACKAGE",
"url": "https://github.com/pyload/pyload"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "pyLoad CNL and captcha handlers allow Code Injection via unsanitized parameters"
}
GHSA-CJJX-VGMP-VF5G
Vulnerability from github – Published: 2024-11-26 09:30 – Updated: 2024-11-26 09:30The The InPost Gallery plugin for WordPress is vulnerable to arbitrary shortcode execution via the inpost_gallery_get_shortcode_template AJAX action in all versions up to, and including, 2.1.4.2. 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 authenticated attackers, with Subscriber-level access and above, to execute arbitrary shortcodes.
{
"affected": [],
"aliases": [
"CVE-2024-11002"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-11-26T07:15:05Z",
"severity": "MODERATE"
},
"details": "The The InPost Gallery plugin for WordPress is vulnerable to arbitrary shortcode execution via the inpost_gallery_get_shortcode_template AJAX action in all versions up to, and including, 2.1.4.2. 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 authenticated attackers, with Subscriber-level access and above, to execute arbitrary shortcodes.",
"id": "GHSA-cjjx-vgmp-vf5g",
"modified": "2024-11-26T09:30:48Z",
"published": "2024-11-26T09:30:48Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-11002"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/inpost-gallery/trunk/index.php#L323"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/changeset/3192113"
},
{
"type": "WEB",
"url": "https://wordpress.org/plugins/inpost-gallery/#developers"
},
{
"type": "WEB",
"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/5fbb2dcf-38b8-4ef1-bfea-bf5872cc7e37?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:L",
"type": "CVSS_V3"
}
]
}
GHSA-CJPQ-8G7J-6V2F
Vulnerability from github – Published: 2022-05-02 03:59 – Updated: 2022-05-02 03:59PHP remote file inclusion vulnerability in index.php in CMS S.Builder 3.7 and earlier, when register_globals is enabled, allows remote attackers to execute arbitrary PHP code via a URL in a binn_include_path cookie. NOTE: this can also be leveraged to include and execute arbitrary local files.
{
"affected": [],
"aliases": [
"CVE-2009-4887"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2010-06-11T14:30:00Z",
"severity": "MODERATE"
},
"details": "PHP remote file inclusion vulnerability in index.php in CMS S.Builder 3.7 and earlier, when register_globals is enabled, allows remote attackers to execute arbitrary PHP code via a URL in a binn_include_path cookie. NOTE: this can also be leveraged to include and execute arbitrary local files.",
"id": "GHSA-cjpq-8g7j-6v2f",
"modified": "2022-05-02T03:59:09Z",
"published": "2022-05-02T03:59:09Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-4887"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/49139"
},
{
"type": "WEB",
"url": "http://www.exploit-db.com/exploits/8172"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/34037"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-CJXJ-WRCR-J6P4
Vulnerability from github – Published: 2022-05-24 16:58 – Updated: 2024-04-04 02:17An issue was discovered in Softing uaGate SI 1.60.01. A maintenance script, that is executable via sudo, is vulnerable to file path injection. This enables the Attacker to write files with superuser privileges in specific locations.
{
"affected": [],
"aliases": [
"CVE-2019-11526"
],
"database_specific": {
"cwe_ids": [
"CWE-732",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2019-10-10T19:15:00Z",
"severity": "CRITICAL"
},
"details": "An issue was discovered in Softing uaGate SI 1.60.01. A maintenance script, that is executable via sudo, is vulnerable to file path injection. This enables the Attacker to write files with superuser privileges in specific locations.",
"id": "GHSA-cjxj-wrcr-j6p4",
"modified": "2024-04-04T02:17:50Z",
"published": "2022-05-24T16:58:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-11526"
},
{
"type": "WEB",
"url": "https://security.mioso.com/CVE-2019-11526-en.html"
}
],
"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-CM2R-2MX3-6FV2
Vulnerability from github – Published: 2022-05-24 16:53 – Updated: 2022-05-24 16:53The Rank Math SEO plugin 1.0.27 for WordPress allows non-admin users to reset the settings via the wp-admin/admin-post.php reset-cmb parameter.
{
"affected": [],
"aliases": [
"CVE-2019-14786"
],
"database_specific": {
"cwe_ids": [
"CWE-862",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2019-08-15T16:15:00Z",
"severity": "MODERATE"
},
"details": "The Rank Math SEO plugin 1.0.27 for WordPress allows non-admin users to reset the settings via the wp-admin/admin-post.php reset-cmb parameter.",
"id": "GHSA-cm2r-2mx3-6fv2",
"modified": "2022-05-24T16:53:43Z",
"published": "2022-05-24T16:53:43Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-14786"
},
{
"type": "WEB",
"url": "https://rankmath.com/changelog"
},
{
"type": "WEB",
"url": "https://wpvulndb.com/vulnerabilities/9375"
},
{
"type": "WEB",
"url": "https://www.pluginvulnerabilities.com/2019/06/20/authenticated-settings-reset-vulnerability-in-rank-math-seo"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-CM2W-6F5F-6C2H
Vulnerability from github – Published: 2022-05-14 01:35 – Updated: 2022-05-14 01:35Frog CMS 0.9.5 allows PHP code execution via <?php to the admin/?/layout/edit/1 URI.
{
"affected": [],
"aliases": [
"CVE-2018-20772"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2019-02-11T02:29:00Z",
"severity": "HIGH"
},
"details": "Frog CMS 0.9.5 allows PHP code execution via \u003c?php to the admin/?/layout/edit/1 URI.",
"id": "GHSA-cm2w-6f5f-6c2h",
"modified": "2022-05-14T01:35:17Z",
"published": "2022-05-14T01:35:17Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-20772"
},
{
"type": "WEB",
"url": "https://github.com/philippe/FrogCMS/issues/24"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-CM3H-P9X9-H6FR
Vulnerability from github – Published: 2022-05-01 18:36 – Updated: 2025-04-03 15:30Unspecified vulnerability in BitDefender allows attackers to execute arbitrary code via unspecified vectors, aka EEYEB-20071024. NOTE: as of 20071029, the only disclosure is a vague pre-advisory with no actionable information. However, since it is from a well-known researcher, it is being assigned a CVE identifier for tracking purposes.
{
"affected": [],
"aliases": [
"CVE-2007-5775"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-11-01T16:46:00Z",
"severity": "HIGH"
},
"details": "Unspecified vulnerability in BitDefender allows attackers to execute arbitrary code via unspecified vectors, aka EEYEB-20071024. NOTE: as of 20071029, the only disclosure is a vague pre-advisory with no actionable information. However, since it is from a well-known researcher, it is being assigned a CVE identifier for tracking purposes.",
"id": "GHSA-cm3h-p9x9-h6fr",
"modified": "2025-04-03T15:30:41Z",
"published": "2022-05-01T18:36:38Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-5775"
},
{
"type": "WEB",
"url": "http://research.eeye.com/html/advisories/upcoming/20071024.html"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/26210"
}
],
"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-CM6R-5GC3-M2WJ
Vulnerability from github – Published: 2022-05-01 18:44 – Updated: 2022-05-01 18:44Multiple PHP remote file inclusion vulnerabilities in TeamCal Pro 3.1.000 and earlier allow remote attackers to execute arbitrary PHP code via a URL in the CONF[app_root] parameter to (1) tcuser.class.php, (2) absencecount.inc.php, (3) avatar.inc.php, (4) csvhandler.class.php, (5) functions.tcpro.php, (6) header.html.inc.php, (7) joomlajack.tcpro.php, (8) menu.inc.php, (9) other.inc.php, (10) tcabsence.class.php, (11) tcabsencegroup.class.php, (12) tcallowance.class.php, (13) tcannouncement.class.php, (14) tcconfig.class.php, (15) tcdaynote.class.php, (16) tcgroup.class.php, (17) tcholiday.class.php, (18) tclogin.class.php, (19) tcmonth.class.php, (20) tctemplate.class.php, (21) tcusergroup.class.php, or (22) tcuseroption.class.php in includes/, possibly a related issue to CVE-2006-4845.
{
"affected": [],
"aliases": [
"CVE-2007-6553"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-12-28T00:46:00Z",
"severity": "MODERATE"
},
"details": "Multiple PHP remote file inclusion vulnerabilities in TeamCal Pro 3.1.000 and earlier allow remote attackers to execute arbitrary PHP code via a URL in the CONF[app_root] parameter to (1) tcuser.class.php, (2) absencecount.inc.php, (3) avatar.inc.php, (4) csvhandler.class.php, (5) functions.tcpro.php, (6) header.html.inc.php, (7) joomlajack.tcpro.php, (8) menu.inc.php, (9) other.inc.php, (10) tcabsence.class.php, (11) tcabsencegroup.class.php, (12) tcallowance.class.php, (13) tcannouncement.class.php, (14) tcconfig.class.php, (15) tcdaynote.class.php, (16) tcgroup.class.php, (17) tcholiday.class.php, (18) tclogin.class.php, (19) tcmonth.class.php, (20) tctemplate.class.php, (21) tcusergroup.class.php, or (22) tcuseroption.class.php in includes/, possibly a related issue to CVE-2006-4845.",
"id": "GHSA-cm6r-5gc3-m2wj",
"modified": "2022-05-01T18:44:09Z",
"published": "2022-05-01T18:44:09Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-6553"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/39212"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/4785"
},
{
"type": "WEB",
"url": "http://osvdb.org/39805"
},
{
"type": "WEB",
"url": "http://osvdb.org/39806"
},
{
"type": "WEB",
"url": "http://osvdb.org/39807"
},
{
"type": "WEB",
"url": "http://osvdb.org/39808"
},
{
"type": "WEB",
"url": "http://osvdb.org/39809"
},
{
"type": "WEB",
"url": "http://osvdb.org/39810"
},
{
"type": "WEB",
"url": "http://osvdb.org/39811"
},
{
"type": "WEB",
"url": "http://osvdb.org/39812"
},
{
"type": "WEB",
"url": "http://osvdb.org/39813"
},
{
"type": "WEB",
"url": "http://osvdb.org/39814"
},
{
"type": "WEB",
"url": "http://osvdb.org/39815"
},
{
"type": "WEB",
"url": "http://osvdb.org/39816"
},
{
"type": "WEB",
"url": "http://osvdb.org/39817"
},
{
"type": "WEB",
"url": "http://osvdb.org/39818"
},
{
"type": "WEB",
"url": "http://osvdb.org/39819"
},
{
"type": "WEB",
"url": "http://osvdb.org/39820"
},
{
"type": "WEB",
"url": "http://osvdb.org/39821"
},
{
"type": "WEB",
"url": "http://osvdb.org/39822"
},
{
"type": "WEB",
"url": "http://osvdb.org/39823"
},
{
"type": "WEB",
"url": "http://osvdb.org/39824"
},
{
"type": "WEB",
"url": "http://osvdb.org/39825"
},
{
"type": "WEB",
"url": "http://osvdb.org/39826"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/27022"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-CMMV-W3J8-5HM4
Vulnerability from github – Published: 2024-04-03 12:31 – Updated: 2026-04-01 18:31Unrestricted Upload of File with Dangerous Type vulnerability in InstaWP Team InstaWP Connect allows Code Injection.This issue affects InstaWP Connect: from n/a through 0.1.0.8.
{
"affected": [],
"aliases": [
"CVE-2024-25918"
],
"database_specific": {
"cwe_ids": [
"CWE-434",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-04-03T12:15:10Z",
"severity": "CRITICAL"
},
"details": "Unrestricted Upload of File with Dangerous Type vulnerability in InstaWP Team InstaWP Connect allows Code Injection.This issue affects InstaWP Connect: from n/a through 0.1.0.8.",
"id": "GHSA-cmmv-w3j8-5hm4",
"modified": "2026-04-01T18:31:44Z",
"published": "2024-04-03T12:31:06Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-25918"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/Wordpress/Plugin/instawp-connect/vulnerability/wordpress-instawp-connect-plugin-0-1-0-8-remote-code-execution-vulnerability?_s_id=cve"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/vulnerability/instawp-connect/wordpress-instawp-connect-plugin-0-1-0-8-remote-code-execution-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I: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.