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.
8326 vulnerabilities reference this CWE, most recent first.
GHSA-PW79-H962-2RW9
Vulnerability from github – Published: 2022-05-17 01:37 – Updated: 2022-05-17 01:37The App::Context module 0.01 through 0.968 for Perl does not properly use the Storable::thaw function, which allows remote attackers to execute arbitrary code via a crafted request to (1) App::Session::Cookie or (2) App::Session::HTMLHidden, which is not properly handled when it is deserialized.
{
"affected": [],
"aliases": [
"CVE-2012-6141"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2014-06-04T23:55:00Z",
"severity": "HIGH"
},
"details": "The App::Context module 0.01 through 0.968 for Perl does not properly use the Storable::thaw function, which allows remote attackers to execute arbitrary code via a crafted request to (1) App::Session::Cookie or (2) App::Session::HTMLHidden, which is not properly handled when it is deserialized.",
"id": "GHSA-pw79-h962-2rw9",
"modified": "2022-05-17T01:37:42Z",
"published": "2022-05-17T01:37:42Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2012-6141"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/84198"
},
{
"type": "WEB",
"url": "http://seclists.org/oss-sec/2013/q2/318"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-PW85-C3XJ-RM6M
Vulnerability from github – Published: 2022-05-02 03:41 – Updated: 2022-05-02 03:41Mozilla Firefox before 3.0.14, and 3.5.x before 3.5.3, does not properly manage pointers for the columns (aka TreeColumns) of a XUL tree element, which allows remote attackers to execute arbitrary code via a crafted HTML document, related to a "dangling pointer vulnerability."
{
"affected": [],
"aliases": [
"CVE-2009-3077"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-09-10T21:30:00Z",
"severity": "HIGH"
},
"details": "Mozilla Firefox before 3.0.14, and 3.5.x before 3.5.3, does not properly manage pointers for the columns (aka TreeColumns) of a XUL tree element, which allows remote attackers to execute arbitrary code via a crafted HTML document, related to a \"dangling pointer vulnerability.\"",
"id": "GHSA-pw85-c3xj-rm6m",
"modified": "2022-05-02T03:41:30Z",
"published": "2022-05-02T03:41:30Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-3077"
},
{
"type": "WEB",
"url": "https://bugzilla.mozilla.org/show_bug.cgi?id=506871"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A10730"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A5606"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-security-announce/2010-06/msg00001.html"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/36669"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/36670"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/36671"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/36692"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/37098"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/38977"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/39001"
},
{
"type": "WEB",
"url": "http://www.debian.org/security/2009/dsa-1885"
},
{
"type": "WEB",
"url": "http://www.mozilla.org/security/announce/2009/mfsa2009-49.html"
},
{
"type": "WEB",
"url": "http://www.novell.com/linux/security/advisories/2009_48_firefox.html"
},
{
"type": "WEB",
"url": "http://www.redhat.com/support/errata/RHSA-2009-1430.html"
},
{
"type": "WEB",
"url": "http://www.redhat.com/support/errata/RHSA-2009-1431.html"
},
{
"type": "WEB",
"url": "http://www.redhat.com/support/errata/RHSA-2009-1432.html"
},
{
"type": "WEB",
"url": "http://www.redhat.com/support/errata/RHSA-2010-0153.html"
},
{
"type": "WEB",
"url": "http://www.redhat.com/support/errata/RHSA-2010-0154.html"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/36343"
},
{
"type": "WEB",
"url": "http://www.ubuntu.com/usn/USN-915-1"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2010/0650"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-PW8R-X2QM-3H5M
Vulnerability from github – Published: 2022-05-14 01:57 – Updated: 2023-08-16 09:30Apache Struts 2 before 2.3.14.3 allows remote attackers to execute arbitrary OGNL code via a request with a crafted value that contains both "${}" and "%{}" sequences, which causes the OGNL code to be evaluated twice.
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "org.apache.struts:struts2-core"
},
"ranges": [
{
"events": [
{
"introduced": "2.0.0"
},
{
"fixed": "2.3.14.3"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.apache.struts.xwork:xwork-core"
},
"ranges": [
{
"events": [
{
"introduced": "2.0.0"
},
{
"fixed": "2.3.14.3"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2013-2135"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2022-11-03T20:39:47Z",
"nvd_published_at": "2013-07-16T18:55:00Z",
"severity": "HIGH"
},
"details": "Apache Struts 2 before 2.3.14.3 allows remote attackers to execute arbitrary OGNL code via a request with a crafted value that contains both \"${}\" and \"%{}\" sequences, which causes the OGNL code to be evaluated twice.",
"id": "GHSA-pw8r-x2qm-3h5m",
"modified": "2023-08-16T09:30:38Z",
"published": "2022-05-14T01:57:01Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2013-2135"
},
{
"type": "WEB",
"url": "https://github.com/apache/struts/commit/01e6b251b4db78bfb7971033652e81d1af4cb3e0"
},
{
"type": "WEB",
"url": "https://github.com/apache/struts/commit/041206d2a693d02c0cb2e72765275e55ba14049f"
},
{
"type": "WEB",
"url": "https://github.com/apache/struts/commit/113c47082c09818bcef65acc436a2d0c7c47aa6c"
},
{
"type": "WEB",
"url": "https://github.com/apache/struts/commit/54e5c912ebd9a1599bfcf7a719da17c28127bbe3"
},
{
"type": "WEB",
"url": "https://github.com/apache/struts/commit/711cf0201cdd319a38cf29238913312355db29ba"
},
{
"type": "WEB",
"url": "https://github.com/apache/struts/commit/8b4fc81daeea3834bcbf73de5f48d0021917aa37"
},
{
"type": "WEB",
"url": "https://github.com/apache/struts/commit/cfb6e9afbae320a4dd5bdd655154ab9fe5a92c16"
},
{
"type": "WEB",
"url": "https://cwiki.apache.org/confluence/display/WW/S2-015"
},
{
"type": "PACKAGE",
"url": "https://github.com/apache/struts"
},
{
"type": "WEB",
"url": "https://issues.apache.org/jira/browse/WW-4090"
},
{
"type": "WEB",
"url": "https://issues.apache.org/jira/browse/WW-4094"
},
{
"type": "WEB",
"url": "https://issues.apache.org/jira/browse/WW-4095"
},
{
"type": "WEB",
"url": "https://web.archive.org/web/20140410223942/http://www.securityfocus.com/bid/64758"
},
{
"type": "WEB",
"url": "http://struts.apache.org/development/2.x/docs/s2-015.html"
},
{
"type": "WEB",
"url": "http://www.oracle.com/technetwork/topics/security/cpujan2014-1972949.html"
},
{
"type": "WEB",
"url": "http://www.oracle.com/technetwork/topics/security/cpuoct2013-1899837.html"
}
],
"schema_version": "1.4.0",
"severity": [],
"summary": "Arbitrary code execution in Apache Struts 2"
}
GHSA-PW8X-JQ9M-HMC9
Vulnerability from github – Published: 2024-07-21 06:30 – Updated: 2024-07-21 06:30A vulnerability was found in DedeCMS 5.7.114. It has been classified as critical. This affects an unknown part of the file article_template_rand.php. The manipulation leads to code injection. It is possible to initiate the attack remotely. The exploit has been disclosed to the public and may be used. The associated identifier of this vulnerability is VDB-271995. NOTE: The vendor was contacted early about this disclosure but did not respond in any way.
{
"affected": [],
"aliases": [
"CVE-2024-6940"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-07-21T06:15:04Z",
"severity": "MODERATE"
},
"details": "A vulnerability was found in DedeCMS 5.7.114. It has been classified as critical. This affects an unknown part of the file article_template_rand.php. The manipulation leads to code injection. It is possible to initiate the attack remotely. The exploit has been disclosed to the public and may be used. The associated identifier of this vulnerability is VDB-271995. NOTE: The vendor was contacted early about this disclosure but did not respond in any way.",
"id": "GHSA-pw8x-jq9m-hmc9",
"modified": "2024-07-21T06:30:35Z",
"published": "2024-07-21T06:30:35Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-6940"
},
{
"type": "WEB",
"url": "https://gitee.com/fushuling/cve/blob/master/dedeCMS%20V5.7.114%20article_template_rand.php%20code%20injection.md"
},
{
"type": "WEB",
"url": "https://vuldb.com/?ctiid.271995"
},
{
"type": "WEB",
"url": "https://vuldb.com/?id.271995"
},
{
"type": "WEB",
"url": "https://vuldb.com/?submit.372810"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:L",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
GHSA-PWC5-C4JF-RGX2
Vulnerability from github – Published: 2022-05-01 07:13 – Updated: 2022-05-01 07:13PHP remote file inclusion vulnerability in artlinks.dispnew.php in the Artlinks component (com_artlinks) for Mambo allows remote attackers to execute arbitrary PHP code via a URL in the mosConfig_absolute_path parameter.
{
"affected": [],
"aliases": [
"CVE-2006-3949"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2006-08-01T21:04:00Z",
"severity": "MODERATE"
},
"details": "PHP remote file inclusion vulnerability in artlinks.dispnew.php in the Artlinks component (com_artlinks) for Mambo allows remote attackers to execute arbitrary PHP code via a URL in the mosConfig_absolute_path parameter.",
"id": "GHSA-pwc5-c4jf-rgx2",
"modified": "2022-05-01T07:13:48Z",
"published": "2022-05-01T07:13:48Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-3949"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/28075"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/1318"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/441541/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/19223"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-PWF7-47C3-MFHX
Vulnerability from github – Published: 2025-09-29 17:51 – Updated: 2025-09-29 17:51Summary
There are three potential attacks of arbitrary code injection vulnerability in the composite action at action.yml.
Details
The GitHub Action variables inputs.prek-version, inputs.extra_args, and inputs.extra-args can be used to execute arbitrary code in the context of the action.
PoC
- uses: j178/prek-action@v1.0.5
with:
prek-version: $(printenv >> $GITHUB_STEP_SUMMARY && echo "0.2.2")
extra_args: '&& echo "MY_SECRET with a character is: ${MY_SECRET:0:1}a${MY_SECRET:1}" >> $GITHUB_STEP_SUMMARY && echo ""'
env:
MY_SECRET: ${{ secrets.MY_SECRET }}
The previous example will print all the environment variables, and it will expose MY_SECRET environment variable value to the summary of the workflow. An attacker could potentially use this vector to compromise the security of the target repository, even passing unnotice because the action will run normally.
Impact
Critical, CWE-94
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 1.0.5"
},
"package": {
"ecosystem": "GitHub Actions",
"name": "j178/prek-action"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.0.6"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2025-09-29T17:51:19Z",
"nvd_published_at": null,
"severity": "CRITICAL"
},
"details": "### Summary\nThere are three potential attacks of arbitrary code injection vulnerability in the composite action at _action.yml_.\n\n### Details\nThe GitHub Action variables `inputs.prek-version`, `inputs.extra_args`, and `inputs.extra-args` can be used to execute arbitrary code in the context of the action.\n\n### PoC\n```yaml\n- uses: j178/prek-action@v1.0.5\n with:\n prek-version: $(printenv \u003e\u003e $GITHUB_STEP_SUMMARY \u0026\u0026 echo \"0.2.2\")\n extra_args: \u0027\u0026\u0026 echo \"MY_SECRET with a character is: ${MY_SECRET:0:1}a${MY_SECRET:1}\" \u003e\u003e $GITHUB_STEP_SUMMARY \u0026\u0026 echo \"\"\u0027\n env:\n MY_SECRET: ${{ secrets.MY_SECRET }}\n```\n\nThe previous example will print all the environment variables, and it will expose `MY_SECRET` environment variable value to the summary of the workflow. An attacker could potentially use this vector to compromise the security of the target repository, even passing unnotice because the action will run normally.\n\n### Impact\nCritical, CWE-94",
"id": "GHSA-pwf7-47c3-mfhx",
"modified": "2025-09-29T17:51:19Z",
"published": "2025-09-29T17:51:19Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/j178/prek-action/security/advisories/GHSA-pwf7-47c3-mfhx"
},
{
"type": "WEB",
"url": "https://github.com/j178/prek-action/commit/6b7c6ef5c3875c766893b881b40773cd5605bde3"
},
{
"type": "PACKAGE",
"url": "https://github.com/j178/prek-action"
}
],
"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"
}
],
"summary": "j178/prek-action vulnerable to arbitrary code injection in composite action"
}
GHSA-PWFV-F76V-VRF3
Vulnerability from github – Published: 2025-01-22 12:33 – Updated: 2025-01-22 12:33The The GamiPress – Gamification plugin to reward points, achievements, badges & ranks in WordPress plugin for WordPress is vulnerable to arbitrary shortcode execution via the gamipress_ajax_get_logs() function in all versions up to, and including, 7.2.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-13495"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-01-22T11:15:08Z",
"severity": "HIGH"
},
"details": "The The GamiPress \u2013 Gamification plugin to reward points, achievements, badges \u0026 ranks in WordPress plugin for WordPress is vulnerable to arbitrary shortcode execution via the gamipress_ajax_get_logs() function in all versions up to, and including, 7.2.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-pwfv-f76v-vrf3",
"modified": "2025-01-22T12:33:05Z",
"published": "2025-01-22T12:33:05Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-13495"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/gamipress/trunk/includes/ajax-functions.php#L39"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/changeset/3226227"
},
{
"type": "WEB",
"url": "https://wordpress.org/plugins/gamipress/#developers"
},
{
"type": "WEB",
"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/55fa8423-9a41-4afe-9401-03d232caa656?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-PWG8-QCW7-2HJM
Vulnerability from github – Published: 2022-05-01 23:49 – Updated: 2022-05-01 23:49PHP remote file inclusion vulnerability in index.php in Wajox Software microSSys CMS 1.5 and earlier, when register_globals is enabled, allows remote attackers to execute arbitrary PHP code via a URL in an arbitrary element of the PAGES array parameter.
{
"affected": [],
"aliases": [
"CVE-2008-2396"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-05-21T13:24:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in index.php in Wajox Software microSSys CMS 1.5 and earlier, when register_globals is enabled, allows remote attackers to execute arbitrary PHP code via a URL in an arbitrary element of the PAGES array parameter.",
"id": "GHSA-pwg8-qcw7-2hjm",
"modified": "2022-05-01T23:49:36Z",
"published": "2022-05-01T23:49:36Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-2396"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/42518"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/5651"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/30264"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/29278"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-PWHJ-4XXW-VR57
Vulnerability from github – Published: 2022-05-17 00:45 – Updated: 2022-05-17 00:45PHP remote file inclusion vulnerability in upload/admin/frontpage_right.php in Agares Media ThemeSiteScript 1.0 allows remote attackers to execute arbitrary PHP code via a URL in the loadadminpage parameter.
{
"affected": [],
"aliases": [
"CVE-2008-5066"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-11-13T17:24:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in upload/admin/frontpage_right.php in Agares Media ThemeSiteScript 1.0 allows remote attackers to execute arbitrary PHP code via a URL in the loadadminpage parameter.",
"id": "GHSA-pwhj-4xxw-vr57",
"modified": "2022-05-17T00:45:29Z",
"published": "2022-05-17T00:45:29Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-5066"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/6859"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/4592"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/31959"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2008/2959"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-PWWF-7F48-895H
Vulnerability from github – Published: 2022-12-22 21:30 – Updated: 2025-04-15 15:30A file with a long filename could have had its filename truncated to remove the valid extension, leaving a malicious extension in its place. This could potentially led to user confusion and the execution of malicious code.
Note: This issue was originally included in the advisories for Thunderbird 102.6, but a patch (specific to Thunderbird) was omitted, resulting in it actually being fixed in Thunderbird 102.6.1. This vulnerability affects Firefox < 108, Thunderbird < 102.6.1, Thunderbird < 102.6, and Firefox ESR < 102.6.
{
"affected": [],
"aliases": [
"CVE-2022-46874"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-12-22T20:15:00Z",
"severity": "HIGH"
},
"details": "A file with a long filename could have had its filename truncated to remove the valid extension, leaving a malicious extension in its place. This could potentially led to user confusion and the execution of malicious code.\u003cbr/\u003e*Note*: This issue was originally included in the advisories for Thunderbird 102.6, but a patch (specific to Thunderbird) was omitted, resulting in it actually being fixed in Thunderbird 102.6.1. This vulnerability affects Firefox \u003c 108, Thunderbird \u003c 102.6.1, Thunderbird \u003c 102.6, and Firefox ESR \u003c 102.6.",
"id": "GHSA-pwwf-7f48-895h",
"modified": "2025-04-15T15:30:38Z",
"published": "2022-12-22T21:30:27Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-46874"
},
{
"type": "WEB",
"url": "https://bugzilla.mozilla.org/show_bug.cgi?id=1746139"
},
{
"type": "WEB",
"url": "https://security.gentoo.org/glsa/202305-06"
},
{
"type": "WEB",
"url": "https://security.gentoo.org/glsa/202305-13"
},
{
"type": "WEB",
"url": "https://www.mozilla.org/security/advisories/mfsa2022-51"
},
{
"type": "WEB",
"url": "https://www.mozilla.org/security/advisories/mfsa2022-52"
},
{
"type": "WEB",
"url": "https://www.mozilla.org/security/advisories/mfsa2022-53"
},
{
"type": "WEB",
"url": "https://www.mozilla.org/security/advisories/mfsa2022-54"
}
],
"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: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.