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.

8376 vulnerabilities reference this CWE, most recent first.

GHSA-4CVG-J32H-GMP6

Vulnerability from github – Published: 2022-05-01 07:12 – Updated: 2022-05-01 07:12
VLAI
Details

PHP remote file inclusion vulnerability in extadminmenus.class.php in the MultiBanners 1.0.1 for Mambo allows remote attackers to execute arbitrary PHP code via a URL in the mosConfig_absolute_path parameter.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2006-3846"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2006-07-25T23:04:00Z",
    "severity": "MODERATE"
  },
  "details": "PHP remote file inclusion vulnerability in extadminmenus.class.php in the MultiBanners 1.0.1 for Mambo allows remote attackers to execute arbitrary PHP code via a URL in the mosConfig_absolute_path parameter.",
  "id": "GHSA-4cvg-j32h-gmp6",
  "modified": "2022-05-01T07:12:56Z",
  "published": "2022-05-01T07:12:56Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2006-3846"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/27916"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/21168"
    },
    {
      "type": "WEB",
      "url": "http://securityreason.com/securityalert/1277"
    },
    {
      "type": "WEB",
      "url": "http://solpotcrew.org/adv/BlueSpy-adv-multibanners.txt"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/archive/1/440881/100/0/threaded"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/19100"
    },
    {
      "type": "WEB",
      "url": "http://www.vupen.com/english/advisories/2006/2933"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-4F92-W438-F484

Vulnerability from github – Published: 2024-05-02 12:30 – Updated: 2024-07-05 20:04
VLAI
Summary
CraftBeerPi 4 allows arbitrary code execution
Details

URL GET parameter "logtime" utilized within the "downloadlog" function from "cbpi/http_endpoints/http_system.py" is subsequently passed to the "os.system" function in "cbpi/controller/system_controller.py" without prior validation allowing arbitrary code execution. This issue affects CraftBeerPi 4: from 4.0.0.58 (commit 563fae9) before 4.4.1.a1 (commit 57572c7).

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "cbpi4"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "4.0.0.58"
            },
            {
              "fixed": "4.4.1.a1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2024-3955"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2024-07-05T20:04:18Z",
    "nvd_published_at": "2024-05-02T10:15:08Z",
    "severity": "CRITICAL"
  },
  "details": "URL GET parameter \"logtime\" utilized within the \"downloadlog\" function from \"cbpi/http_endpoints/http_system.py\" is subsequently passed to the \"os.system\" function in \"cbpi/controller/system_controller.py\" without prior validation allowing arbitrary code execution. This issue affects CraftBeerPi 4: from 4.0.0.58 (commit 563fae9) before 4.4.1.a1 (commit 57572c7).\n\n",
  "id": "GHSA-4f92-w438-f484",
  "modified": "2024-07-05T20:04:18Z",
  "published": "2024-05-02T12:30:40Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-3955"
    },
    {
      "type": "WEB",
      "url": "https://github.com/PiBrewing/craftbeerpi4/issues/132"
    },
    {
      "type": "WEB",
      "url": "https://cert.pl/en/posts/2024/05/CVE-2024-3955"
    },
    {
      "type": "WEB",
      "url": "https://cert.pl/posts/2024/05/CVE-2024-3955"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/PiBrewing/craftbeerpi4"
    }
  ],
  "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": "CraftBeerPi 4 allows arbitrary code execution"
}

GHSA-4FF4-29XF-F5HG

Vulnerability from github – Published: 2022-05-01 07:06 – Updated: 2022-05-01 07:06
VLAI
Details

Ralf Image Gallery (RIG) 0.7.4 and other versions before 1.0, when register_globals is enabled, allows remote attackers to conduct PHP remote file inclusion and directory traversal attacks via URLs or ".." sequences in the (1) dir_abs_src parameter in (a) check_entry.php, (b) admin_album.php, (c) admin_image.php, and (d) admin_util.php; and the (2) dir_abs_admin_src parameter in admin_album.php and admin_image.php. NOTE: this issue can be leveraged to conduct cross-site scripting (XSS) attacks.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2006-3210"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2006-06-24T01:06:00Z",
    "severity": "MODERATE"
  },
  "details": "Ralf Image Gallery (RIG) 0.7.4 and other versions before 1.0, when register_globals is enabled, allows remote attackers to conduct PHP remote file inclusion and directory traversal attacks via URLs or \"..\" sequences in the (1) dir_abs_src parameter in (a) check_entry.php, (b) admin_album.php, (c) admin_image.php, and (d) admin_util.php; and the (2) dir_abs_admin_src parameter in admin_album.php and admin_image.php.  NOTE: this issue can be leveraged to conduct cross-site scripting (XSS) attacks.",
  "id": "GHSA-4ff4-29xf-f5hg",
  "modified": "2022-05-01T07:06:43Z",
  "published": "2022-05-01T07:06:43Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2006-3210"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/27256"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/27257"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/27259"
    },
    {
      "type": "WEB",
      "url": "http://rig.powerpulsar.com/#news"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/20771"
    },
    {
      "type": "WEB",
      "url": "http://securityreason.com/securityalert/1136"
    },
    {
      "type": "WEB",
      "url": "http://www.majorsecurity.de/advisory/major_rls18.txt"
    },
    {
      "type": "WEB",
      "url": "http://www.osvdb.org/26753"
    },
    {
      "type": "WEB",
      "url": "http://www.osvdb.org/26754"
    },
    {
      "type": "WEB",
      "url": "http://www.osvdb.org/26755"
    },
    {
      "type": "WEB",
      "url": "http://www.osvdb.org/26756"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/archive/1/437818/100/0/threaded"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/archive/1/438645/100/100/threaded"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/18548"
    },
    {
      "type": "WEB",
      "url": "http://www.vupen.com/english/advisories/2006/2477"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-4FF5-FG46-2W34

Vulnerability from github – Published: 2022-05-02 03:55 – Updated: 2025-04-11 03:33
VLAI
Details

The administrative web console on the TANDBERG Video Communication Server (VCS) before X4.3 uses predictable session cookies in (1) tandberg/web/lib/secure.php and (2) tandberg/web/user/lib/secure.php, which makes it easier for remote attackers to bypass authentication, and execute arbitrary code by loading a custom software update, via a crafted "Cookie: tandberg_login=" HTTP header.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2009-4509"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2010-04-13T17:30:00Z",
    "severity": "HIGH"
  },
  "details": "The administrative web console on the TANDBERG Video Communication Server (VCS) before X4.3 uses predictable session cookies in (1) tandberg/web/lib/secure.php and (2) tandberg/web/user/lib/secure.php, which makes it easier for remote attackers to bypass authentication, and execute arbitrary code by loading a custom software update, via a crafted \"Cookie: tandberg_login=\" HTTP header.",
  "id": "GHSA-4ff5-fg46-2w34",
  "modified": "2025-04-11T03:33:45Z",
  "published": "2022-05-02T03:55:20Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2009-4509"
    },
    {
      "type": "WEB",
      "url": "http://ftp.tandberg.com/pub/software/vcs/TANDBERG%20Video%20Communication%20Server%20Software%20Release%20Notes%20%28X4%29.pdf"
    },
    {
      "type": "WEB",
      "url": "http://ftp.tandberg.com/pub/software/vcs/TANDBERG%20Video%20Communication%20Server%20Software%20Release%20Notes%20(X4).pdf"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/39275"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/archive/1/510672/100/0/threaded"
    },
    {
      "type": "WEB",
      "url": "http://www.vsecurity.com/resources/advisory/20100409-1"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-4FGQ-FPQ9-MR3G

Vulnerability from github – Published: 2025-10-03 14:16 – Updated: 2025-10-03 14:16
VLAI
Summary
Claude Code can execute commands prior to the startup trust dialog
Details

Due to a bug in the startup trust dialog implementation, Claude Code could be tricked to execute code contained in a project before the user accepted the startup trust dialog. Exploiting this requires a user to start Claude Code in an untrusted directory.

Users on standard Claude Code auto-update will have received this fix automatically. Users performing manual updates are advised to update to the latest version.

Thank you to https://hackerone.com/avivdon for reporting this issue!

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "@anthropic-ai/claude-code"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.0.111"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2025-59536"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2025-10-03T14:16:34Z",
    "nvd_published_at": "2025-10-03T07:15:44Z",
    "severity": "HIGH"
  },
  "details": "Due to a bug in the startup trust dialog implementation, Claude Code could be tricked to execute code contained in a project before the user accepted the startup trust dialog. Exploiting this requires a user to start Claude Code in an untrusted directory. \n\nUsers on standard Claude Code auto-update will have received this fix automatically. Users performing manual updates are advised to update to the latest version.\n\nThank you to https://hackerone.com/avivdon for reporting this issue!",
  "id": "GHSA-4fgq-fpq9-mr3g",
  "modified": "2025-10-03T14:16:34Z",
  "published": "2025-10-03T14:16:34Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/anthropics/claude-code/security/advisories/GHSA-4fgq-fpq9-mr3g"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-59536"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/anthropics/claude-code"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Claude Code can execute commands prior to the startup trust dialog "
}

GHSA-4FQ3-MR56-CG6R

Vulnerability from github – Published: 2018-10-17 17:23 – Updated: 2024-03-20 14:20
VLAI
Summary
Spring Data Commons remote code injection vulnerability
Details

Spring Data Commons, versions prior to 1.13 to 1.13.10, 2.0 to 2.0.5, and older unsupported versions, contain a property binder vulnerability caused by improper neutralization of special elements. An unauthenticated remote malicious user (or attacker) can supply specially crafted request parameters against Spring Data REST backed HTTP resources or using Spring Data's projection-based request payload binding that can lead to a remote code execution attack.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Maven",
        "name": "org.springframework.data:spring-data-commons"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "1.13.0"
            },
            {
              "fixed": "1.13.11"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Maven",
        "name": "org.springframework.data:spring-data-commons"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "2.0.0"
            },
            {
              "fixed": "2.0.6"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2018-1273"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-20",
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2020-06-16T20:58:14Z",
    "nvd_published_at": "2018-04-11T13:29:00Z",
    "severity": "CRITICAL"
  },
  "details": "Spring Data Commons, versions prior to 1.13 to 1.13.10, 2.0 to 2.0.5, and older unsupported versions, contain a property binder vulnerability caused by improper neutralization of special elements. An unauthenticated remote malicious user (or attacker) can supply specially crafted request parameters against Spring Data REST backed HTTP resources or using Spring Data\u0027s projection-based request payload binding that can lead to a remote code execution attack.",
  "id": "GHSA-4fq3-mr56-cg6r",
  "modified": "2024-03-20T14:20:41Z",
  "published": "2018-10-17T17:23:24Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2018-1273"
    },
    {
      "type": "WEB",
      "url": "https://github.com/spring-projects/spring-data-commons/issues/1721"
    },
    {
      "type": "WEB",
      "url": "https://github.com/spring-projects/spring-data-commons/commit/ae1dd2741ce06d44a0966ecbd6f47beabde2b653"
    },
    {
      "type": "WEB",
      "url": "https://github.com/spring-projects/spring-data-commons/commit/b1a20ae1e82a63f99b3afc6f2aaedb3bf4dc432a"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/advisories/GHSA-4fq3-mr56-cg6r"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/spring-projects/spring-data-commons"
    },
    {
      "type": "WEB",
      "url": "https://pivotal.io/security/cve-2018-1273"
    },
    {
      "type": "WEB",
      "url": "https://www.oracle.com/security-alerts/cpujul2022.html"
    },
    {
      "type": "WEB",
      "url": "http://mail-archives.apache.org/mod_mbox/ignite-dev/201807.mbox/%3CCAK0qHnqzfzmCDFFi6c5Jok19zNkVCz5Xb4sU%3D0f2J_1i4p46zQ%40mail.gmail.com%3E"
    }
  ],
  "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"
    }
  ],
  "summary": "Spring Data Commons remote code injection vulnerability"
}

GHSA-4FQW-Q7F5-3C39

Vulnerability from github – Published: 2022-05-13 01:13 – Updated: 2025-04-12 12:43
VLAI
Details

Unrestricted file upload vulnerability in uploadScript.php in InfiniteWP Admin Panel before 2.4.4, when the allWPFiles query parameter is set, allows remote attackers to execute arbitrary code by uploading a file with a double extension, then accessing it via a direct request to the file in the uploads directory, as demonstrated by the .php.swp filename.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2014-9521"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2015-01-05T20:59:00Z",
    "severity": "HIGH"
  },
  "details": "Unrestricted file upload vulnerability in uploadScript.php in InfiniteWP Admin Panel before 2.4.4, when the allWPFiles query parameter is set, allows remote attackers to execute arbitrary code by uploading a file with a double extension, then accessing it via a direct request to the file in the uploads directory, as demonstrated by the .php.swp filename.",
  "id": "GHSA-4fqw-q7f5-3c39",
  "modified": "2025-04-12T12:43:45Z",
  "published": "2022-05-13T01:13:20Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2014-9521"
    },
    {
      "type": "WEB",
      "url": "https://lifeforms.nl/20141210/infinitewp-vulnerabilities"
    },
    {
      "type": "WEB",
      "url": "http://seclists.org/fulldisclosure/2014/Dec/43"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-4FRQ-G5PX-8JFP

Vulnerability from github – Published: 2026-02-05 18:30 – Updated: 2026-02-06 18:30
VLAI
Details

An issue in ChestnutCMS v.1.5.8 and before allows a remote attacker to execute arbitrary code via the template creation function

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-70073"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-02-05T18:16:10Z",
    "severity": "CRITICAL"
  },
  "details": "An issue in ChestnutCMS v.1.5.8 and before allows a remote attacker to execute arbitrary code via the template creation function",
  "id": "GHSA-4frq-g5px-8jfp",
  "modified": "2026-02-06T18:30:31Z",
  "published": "2026-02-05T18:30:32Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-70073"
    },
    {
      "type": "WEB",
      "url": "https://github.com/liweiyi/ChestnutCMS/issues/8"
    }
  ],
  "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-4FV8-FM6J-XC9R

Vulnerability from github – Published: 2024-04-10 21:30 – Updated: 2025-04-16 00:31
VLAI
Details

An issue in the kiosk mode of Secure Lockdown Multi Application Edition v2.00.219 allows attackers to execute arbitrary code via running a ClickOnce application instance.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-29500"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-04-10T20:15:07Z",
    "severity": "CRITICAL"
  },
  "details": "An issue in the kiosk mode of Secure Lockdown Multi Application Edition v2.00.219 allows attackers to execute arbitrary code via running a ClickOnce application instance.",
  "id": "GHSA-4fv8-fm6j-xc9r",
  "modified": "2025-04-16T00:31:30Z",
  "published": "2024-04-10T21:30:33Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-29500"
    },
    {
      "type": "WEB",
      "url": "https://raeph123.github.io/BlogPosts/inteset/Inteset_Secure_Lockdown_Multi_Application_Edition_-_Vulnerabilities_and_Hardening_Measures_en.html"
    },
    {
      "type": "WEB",
      "url": "https://www.drive-byte.de/en/blog/inteset-bugs-and-hardening"
    }
  ],
  "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-4FVG-M2XR-4CXG

Vulnerability from github – Published: 2022-05-17 05:08 – Updated: 2022-05-17 05:08
VLAI
Details

The WebView class in the Cybozu Live application 1.0.4 and earlier for Android allows remote attackers to execute arbitrary JavaScript code, and obtain sensitive information, via a crafted application that places this code into a local file associated with a file: URL.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2012-4009"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2012-08-31T14:55:00Z",
    "severity": "MODERATE"
  },
  "details": "The WebView class in the Cybozu Live application 1.0.4 and earlier for Android allows remote attackers to execute arbitrary JavaScript code, and obtain sensitive information, via a crafted application that places this code into a local file associated with a file: URL.",
  "id": "GHSA-4fvg-m2xr-4cxg",
  "modified": "2022-05-17T05:08:40Z",
  "published": "2022-05-17T05:08:40Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2012-4009"
    },
    {
      "type": "WEB",
      "url": "http://jvn.jp/en/jp/JVN77393797/index.html"
    },
    {
      "type": "WEB",
      "url": "http://jvndb.jvn.jp/jvndb/JVNDB-2012-000082"
    },
    {
      "type": "WEB",
      "url": "http://magazine.cybozulive.com/2012/08/291200.html"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

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.