Common Weakness Enumeration

CWE-94

Allowed-with-Review

Improper 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.

8301 vulnerabilities reference this CWE, most recent first.

GHSA-CJPQ-8G7J-6V2F

Vulnerability from github – Published: 2022-05-02 03:59 – Updated: 2022-05-02 03:59
VLAI
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.

Show details on source website

{
  "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:17
VLAI
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.

Show details on source website

{
  "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:53
VLAI
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.

Show details on source website

{
  "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:35
VLAI
Details

Frog CMS 0.9.5 allows PHP code execution via <?php to the admin/?/layout/edit/1 URI.

Show details on source website

{
  "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:30
VLAI
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.

Show details on source website

{
  "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:44
VLAI
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.

Show details on source website

{
  "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:31
VLAI
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.

Show details on source website

{
  "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"
    }
  ]
}

GHSA-CMPJ-5W72-JQ28

Vulnerability from github – Published: 2022-05-01 23:46 – Updated: 2022-05-01 23:46
VLAI
Details

Sun Java Web Start and Java Plug-in for JDK and JRE 6 Update 10 and earlier; JDK and JRE 5.0 Update 16 and earlier; and SDK and JRE 1.4.2_18 and earlier allow remote attackers to execute arbitrary code via a crafted jnlp file that modifies the (1) java.home, (2) java.ext.dirs, or (3) user.home System Properties, aka "Java Web Start File Inclusion" and CR 6694892.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2008-2086"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2008-12-05T02:30:00Z",
    "severity": "HIGH"
  },
  "details": "Sun Java Web Start and Java Plug-in for JDK and JRE 6 Update 10 and earlier; JDK and JRE 5.0 Update 16 and earlier; and SDK and JRE 1.4.2_18 and earlier allow remote attackers to execute arbitrary code via a crafted jnlp file that modifies the (1) java.home, (2) java.ext.dirs, or (3) user.home System Properties, aka \"Java Web Start File Inclusion\" and CR 6694892.",
  "id": "GHSA-cmpj-5w72-jq28",
  "modified": "2022-05-01T23:46:35Z",
  "published": "2022-05-01T23:46:35Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2008-2086"
    },
    {
      "type": "WEB",
      "url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A5601"
    },
    {
      "type": "WEB",
      "url": "http://lists.apple.com/archives/security-announce/2009/Feb/msg00003.html"
    },
    {
      "type": "WEB",
      "url": "http://lists.opensuse.org/opensuse-security-announce/2009-01/msg00009.html"
    },
    {
      "type": "WEB",
      "url": "http://lists.opensuse.org/opensuse-security-announce/2009-04/msg00004.html"
    },
    {
      "type": "WEB",
      "url": "http://lists.opensuse.org/opensuse-security-announce/2009-05/msg00000.html"
    },
    {
      "type": "WEB",
      "url": "http://marc.info/?l=bugtraq\u0026m=123678756409861\u0026w=2"
    },
    {
      "type": "WEB",
      "url": "http://marc.info/?l=bugtraq\u0026m=126583436323697\u0026w=2"
    },
    {
      "type": "WEB",
      "url": "http://osvdb.org/50510"
    },
    {
      "type": "WEB",
      "url": "http://rhn.redhat.com/errata/RHSA-2008-1025.html"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/32991"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/33015"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/33528"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/33710"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/34233"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/34605"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/34889"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/35065"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/37386"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/38539"
    },
    {
      "type": "WEB",
      "url": "http://security.gentoo.org/glsa/glsa-200911-02.xml"
    },
    {
      "type": "WEB",
      "url": "http://securityreason.com/securityalert/4693"
    },
    {
      "type": "WEB",
      "url": "http://sunsolve.sun.com/search/document.do?assetkey=1-26-244988-1"
    },
    {
      "type": "WEB",
      "url": "http://support.avaya.com/elmodocs2/security/ASA-2008-486.htm"
    },
    {
      "type": "WEB",
      "url": "http://support.avaya.com/elmodocs2/security/ASA-2009-012.htm"
    },
    {
      "type": "WEB",
      "url": "http://support.nortel.com/go/main.jsp?cscat=BLTNDETAIL\u0026DocumentOID=829914\u0026poid="
    },
    {
      "type": "WEB",
      "url": "http://www.redhat.com/support/errata/RHSA-2008-1018.html"
    },
    {
      "type": "WEB",
      "url": "http://www.redhat.com/support/errata/RHSA-2009-0015.html"
    },
    {
      "type": "WEB",
      "url": "http://www.redhat.com/support/errata/RHSA-2009-0016.html"
    },
    {
      "type": "WEB",
      "url": "http://www.redhat.com/support/errata/RHSA-2009-0445.html"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/archive/1/498907/100/0/threaded"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/32620"
    },
    {
      "type": "WEB",
      "url": "http://www.securitytracker.com/id?1021318"
    },
    {
      "type": "WEB",
      "url": "http://www.us-cert.gov/cas/techalerts/TA08-340A.html"
    },
    {
      "type": "WEB",
      "url": "http://www.vsecurity.com/bulletins/advisories/2008/JWS-props.txt"
    },
    {
      "type": "WEB",
      "url": "http://www.vupen.com/english/advisories/2009/0424"
    },
    {
      "type": "WEB",
      "url": "http://www.vupen.com/english/advisories/2009/0672"
    },
    {
      "type": "WEB",
      "url": "http://www116.nortel.com/pub/repository/CLARIFY/DOCUMENT/2009/03/024431-01.pdf"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-CMQ2-RRCP-64GF

Vulnerability from github – Published: 2022-05-24 16:57 – Updated: 2022-05-24 16:57
VLAI
Details

The KSLABS KSWEB (aka ru.kslabs.ksweb) application 3.93 for Android allows authenticated remote code execution via a POST request to the AJAX handler with the configFile parameter set to the arbitrary file to be written to (and the config_text parameter set to the content of the file to be created). This can be a PHP file that is written to in the public web directory and subsequently executed. The attacker must have network connectivity to the PHP server that is running on the Android device.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2019-15766"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2019-10-03T21:15:00Z",
    "severity": "HIGH"
  },
  "details": "The KSLABS KSWEB (aka ru.kslabs.ksweb) application 3.93 for Android allows authenticated remote code execution via a POST request to the AJAX handler with the configFile parameter set to the arbitrary file to be written to (and the config_text parameter set to the content of the file to be created). This can be a PHP file that is written to in the public web directory and subsequently executed. The attacker must have network connectivity to the PHP server that is running on the Android device.",
  "id": "GHSA-cmq2-rrcp-64gf",
  "modified": "2022-05-24T16:57:49Z",
  "published": "2022-05-24T16:57:49Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2019-15766"
    },
    {
      "type": "WEB",
      "url": "https://play.google.com/store/apps/details?id=ru.kslabs.ksweb\u0026gl=GB"
    },
    {
      "type": "WEB",
      "url": "https://rastating.github.io/ksweb-android-remote-code-execution"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-CMVJ-3PJ4-HRR7

Vulnerability from github – Published: 2025-05-21 18:33 – Updated: 2025-05-21 21:31
VLAI
Details

An issue in Valvesoftware Steam Client Steam Client 1738026274 allows attackers to escalate privileges via a crafted executable or DLL.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-27998"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-05-21T16:15:31Z",
    "severity": "HIGH"
  },
  "details": "An issue in Valvesoftware Steam Client Steam Client 1738026274 allows attackers to escalate privileges via a crafted executable or DLL.",
  "id": "GHSA-cmvj-3pj4-hrr7",
  "modified": "2025-05-21T21:31:38Z",
  "published": "2025-05-21T18:33:30Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-27998"
    },
    {
      "type": "WEB",
      "url": "https://gist.github.com/sornram9254/e8d10efcf246cc50ff3d4f837b261616"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

Mitigation
Architecture and Design

Strategy: Refactoring

Refactor your program so that you do not have to dynamically generate code.

Mitigation
Architecture and Design
  • 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
Implementation

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
Testing

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
Operation

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
Operation

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
Implementation

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.