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.

8381 vulnerabilities reference this CWE, most recent first.

GHSA-5H4F-2C6R-8CJ3

Vulnerability from github – Published: 2022-05-13 01:13 – Updated: 2025-04-11 03:52
VLAI
Details

The masort function in lib/functions.php in phpLDAPadmin 1.2.x before 1.2.2 allows remote attackers to execute arbitrary PHP code via the orderby parameter (aka sortby variable) in a query_engine action to cmd.php, as exploited in the wild in October 2011.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2011-4075"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2011-11-02T17:55:00Z",
    "severity": "HIGH"
  },
  "details": "The masort function in lib/functions.php in phpLDAPadmin 1.2.x before 1.2.2 allows remote attackers to execute arbitrary PHP code via the orderby parameter (aka sortby variable) in a query_engine action to cmd.php, as exploited in the wild in October 2011.",
  "id": "GHSA-5h4f-2c6r-8cj3",
  "modified": "2025-04-11T03:52:34Z",
  "published": "2022-05-13T01:13:46Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2011-4075"
    },
    {
      "type": "WEB",
      "url": "http://dev.metasploit.com/redmine/issues/5820"
    },
    {
      "type": "WEB",
      "url": "http://openwall.com/lists/oss-security/2011/10/24/9"
    },
    {
      "type": "WEB",
      "url": "http://openwall.com/lists/oss-security/2011/10/25/2"
    },
    {
      "type": "WEB",
      "url": "http://osvdb.org/76594"
    },
    {
      "type": "WEB",
      "url": "http://phpldapadmin.git.sourceforge.net/git/gitweb.cgi?p=phpldapadmin/phpldapadmin%3Ba=blobdiff%3Bf=lib/functions.php%3Bh=eb160dc9f7d74e563131e21d4c85d7849a0c6638%3Bhp=19fde9974d4e5eb3bfac04bb223ccbefdb98f9a0%3Bhb=76e6dad13ef77c5448b8dfed1a61e4acc7241165%3Bhpb=5d4245f93ae6f065e7535f268e3cd87a23b07744"
    },
    {
      "type": "WEB",
      "url": "http://phpldapadmin.git.sourceforge.net/git/gitweb.cgi?p=phpldapadmin/phpldapadmin;a=blobdiff;f=lib/functions.php;h=eb160dc9f7d74e563131e21d4c85d7849a0c6638;hp=19fde9974d4e5eb3bfac04bb223ccbefdb98f9a0;hb=76e6dad13ef77c5448b8dfed1a61e4acc7241165;hpb=5d4245f93ae6f065e7535f268e3cd87a23b07744"
    },
    {
      "type": "WEB",
      "url": "http://phpldapadmin.sourceforge.net/wiki/index.php/Main_Page"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/46551"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/46672"
    },
    {
      "type": "WEB",
      "url": "http://sourceforge.net/tracker/index.php?func=detail\u0026aid=3417184\u0026group_id=61828\u0026atid=498546"
    },
    {
      "type": "WEB",
      "url": "http://www.debian.org/security/2011/dsa-2333"
    },
    {
      "type": "WEB",
      "url": "http://www.exploit-db.com/exploits/18021"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/50331"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-5H5R-FFC4-C455

Vulnerability from github – Published: 2019-07-08 20:32 – Updated: 2023-03-06 22:51
VLAI
Summary
strong_password Ruby gem malicious version causing Remote Code Execution vulnerability
Details

The strong_password gem 0.0.7 for Ruby, as distributed on RubyGems.org, included a code-execution backdoor inserted by a third party. Version 0.0.8 does not contain the backdoor.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "RubyGems",
        "name": "strong_password"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.0.7"
            },
            {
              "fixed": "0.0.8"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ],
      "versions": [
        "0.0.7"
      ]
    }
  ],
  "aliases": [
    "CVE-2019-13354"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2019-07-08T20:32:08Z",
    "nvd_published_at": "2019-07-08T14:15:10Z",
    "severity": "CRITICAL"
  },
  "details": "The strong_password gem 0.0.7 for Ruby, as distributed on RubyGems.org, included a code-execution backdoor inserted by a third party. Version 0.0.8 does not contain the backdoor.",
  "id": "GHSA-5h5r-ffc4-c455",
  "modified": "2023-03-06T22:51:34Z",
  "published": "2019-07-08T20:32:35Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2019-13354"
    },
    {
      "type": "WEB",
      "url": "https://benjamin-bouchet.com/blog/vulnerabilite-dans-la-gem-strong_password-0-0-7"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/bdmac/strong_password"
    },
    {
      "type": "WEB",
      "url": "https://github.com/bdmac/strong_password/releases"
    },
    {
      "type": "WEB",
      "url": "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/strong_password/CVE-2019-13354.yml"
    },
    {
      "type": "WEB",
      "url": "https://rubygems.org/gems/strong_password/versions"
    },
    {
      "type": "WEB",
      "url": "https://withatwist.dev/strong-password-rubygem-hijacked.html"
    }
  ],
  "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": "strong_password Ruby gem malicious version causing Remote Code Execution vulnerability"
}

GHSA-5H6W-56P3-F39C

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

In Fiyo CMS 2.x through 2.0.7, attackers may upload a webshell via the content parameter to "/dapur/apps/app_theme/libs/save_file.php" and then execute code.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2017-7625"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2017-04-10T17:59:00Z",
    "severity": "CRITICAL"
  },
  "details": "In Fiyo CMS 2.x through 2.0.7, attackers may upload a webshell via the content parameter to \"/dapur/apps/app_theme/libs/save_file.php\" and then execute code.",
  "id": "GHSA-5h6w-56p3-f39c",
  "modified": "2022-05-17T02:49:49Z",
  "published": "2022-05-17T02:49:49Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2017-7625"
    },
    {
      "type": "WEB",
      "url": "https://github.com/Xyntax/POC-T/blob/2.0/script/fiyo2.0.7-getshell.py"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/97571"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-5H8M-4H4H-VW29

Vulnerability from github – Published: 2022-05-14 01:49 – Updated: 2022-05-14 01:49
VLAI
Details

Adobe Flash Player before 13.0.0.252 and 14.x and 15.x before 15.0.0.223 on Windows and OS X and before 11.2.202.418 on Linux, Adobe AIR before 15.0.0.356, Adobe AIR SDK before 15.0.0.356, and Adobe AIR SDK & Compiler before 15.0.0.356 allow attackers to execute arbitrary code by leveraging an unspecified "type confusion," a different vulnerability than CVE-2014-0584, CVE-2014-0585, CVE-2014-0586, and CVE-2014-0590.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2014-0577"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2014-11-11T23:55:00Z",
    "severity": "HIGH"
  },
  "details": "Adobe Flash Player before 13.0.0.252 and 14.x and 15.x before 15.0.0.223 on Windows and OS X and before 11.2.202.418 on Linux, Adobe AIR before 15.0.0.356, Adobe AIR SDK before 15.0.0.356, and Adobe AIR SDK \u0026 Compiler before 15.0.0.356 allow attackers to execute arbitrary code by leveraging an unspecified \"type confusion,\" a different vulnerability than CVE-2014-0584, CVE-2014-0585, CVE-2014-0586, and CVE-2014-0590.",
  "id": "GHSA-5h8m-4h4h-vw29",
  "modified": "2022-05-14T01:49:23Z",
  "published": "2022-05-14T01:49:23Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2014-0577"
    },
    {
      "type": "WEB",
      "url": "http://helpx.adobe.com/security/products/flash-player/apsb14-24.html"
    },
    {
      "type": "WEB",
      "url": "http://lists.opensuse.org/opensuse-security-announce/2015-04/msg00013.html"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-5HC5-9QWG-W899

Vulnerability from github – Published: 2025-03-11 18:32 – Updated: 2025-03-21 21:31
VLAI
Details

LSC Smart Connect LSC Indoor PTZ Camera 7.6.32 is contains a RCE vulnerability in the tuya_ipc_direct_connect function of the anyka_ipc process. The vulnerability allows arbitrary code execution through the Wi-Fi configuration process when a specially crafted QR code is presented to the camera.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-25680"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-03-11T16:15:17Z",
    "severity": "HIGH"
  },
  "details": "LSC Smart Connect LSC Indoor PTZ Camera 7.6.32 is contains a RCE vulnerability in the tuya_ipc_direct_connect function of the anyka_ipc process. The vulnerability allows arbitrary code execution through the Wi-Fi configuration process when a specially crafted QR code is presented to the camera.",
  "id": "GHSA-5hc5-9qwg-w899",
  "modified": "2025-03-21T21:31:38Z",
  "published": "2025-03-11T18:32:13Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-25680"
    },
    {
      "type": "WEB",
      "url": "https://github.com/Yasha-ops/LSC_Indoor_PTZ_Camera-RCE"
    },
    {
      "type": "WEB",
      "url": "https://github.com/Yasha-ops/vulnerability-research/tree/master/CVE-2025-25680"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-5HFJ-R725-WPC4

Vulnerability from github – Published: 2022-01-14 21:08 – Updated: 2022-08-11 16:55
VLAI
Summary
october/system arbitrary code execution
Details

Impact

Assuming an attacker with access to the backend is able to execute PHP code by using the theme import feature. This will bypass the safe mode feature that prevents PHP execution in the CMS templates.

Patches

Issue has been patched in Build 473 and v1.1.6

Workarounds

Apply https://github.com/octobercms/october/commit/167b592eed291ae1563c8fcc5b9b34a03a300f26 to your installation manually if you are unable to upgrade.

References

Credits to: • Sushi Yushi

For more information

If you have any questions or comments about this advisory: * Email us at hello@octobercms.com

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "october/system"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "1.1.0"
            },
            {
              "fixed": "1.1.6"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "october/system"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.0.473"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2021-32650"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-74",
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2022-01-14T20:47:55Z",
    "nvd_published_at": "2022-01-14T15:15:00Z",
    "severity": "HIGH"
  },
  "details": "### Impact\n\nAssuming an attacker with access to the backend is able to execute PHP code by using the theme import feature. This will bypass the safe mode feature that prevents PHP execution in the CMS templates.\n\n### Patches\n\nIssue has been patched in Build 473 and v1.1.6\n\n### Workarounds\n\nApply https://github.com/octobercms/october/commit/167b592eed291ae1563c8fcc5b9b34a03a300f26 to your installation manually if you are unable to upgrade.\n\n### References\n\nCredits to:\n\u2022 Sushi Yushi\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Email us at [hello@octobercms.com](mailto:hello@octobercms.com)\n",
  "id": "GHSA-5hfj-r725-wpc4",
  "modified": "2022-08-11T16:55:36Z",
  "published": "2022-01-14T21:08:26Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/octobercms/october/security/advisories/GHSA-5hfj-r725-wpc4"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-32650"
    },
    {
      "type": "WEB",
      "url": "https://github.com/octobercms/october/commit/167b592eed291ae1563c8fcc5b9b34a03a300f26"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/octobercms/october"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "october/system arbitrary code execution"
}

GHSA-5HH7-VQXX-V3CJ

Vulnerability from github – Published: 2022-05-17 03:05 – Updated: 2025-04-12 13:07
VLAI
Details

An issue was discovered in Apport before 2.20.4. In apport/ui.py, Apport reads the CrashDB field and it then evaluates the field as Python code if it begins with a "{". This allows remote attackers to execute arbitrary Python code.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2016-9949"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2016-12-17T03:59:00Z",
    "severity": "HIGH"
  },
  "details": "An issue was discovered in Apport before 2.20.4. In apport/ui.py, Apport reads the CrashDB field and it then evaluates the field as Python code if it begins with a \"{\". This allows remote attackers to execute arbitrary Python code.",
  "id": "GHSA-5hh7-vqxx-v3cj",
  "modified": "2025-04-12T13:07:35Z",
  "published": "2022-05-17T03:05:26Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2016-9949"
    },
    {
      "type": "WEB",
      "url": "https://bugs.launchpad.net/apport/+bug/1648806"
    },
    {
      "type": "WEB",
      "url": "https://donncha.is/2016/12/compromising-ubuntu-desktop"
    },
    {
      "type": "WEB",
      "url": "https://github.com/DonnchaC/ubuntu-apport-exploitation"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/40937"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/95011"
    },
    {
      "type": "WEB",
      "url": "http://www.ubuntu.com/usn/USN-3157-1"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-5HHX-V7F6-X7GV

Vulnerability from github – Published: 2025-11-19 20:33 – Updated: 2025-12-22 16:31
VLAI
Summary
Claude Code vulnerable to command execution prior to startup trust dialog
Details

When using Claude Code with Yarn installed, Yarn config files can trigger code execution when running yarn --version. This could lead to a bypass of the directory trust dialog in Claude Code, as plugins and yarnPath could be executed prior to the user accepting the risks of working 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 Benjamin Faller, Redguard AG and Michael Hess 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.39"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2025-65099"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2025-11-19T20:33:10Z",
    "nvd_published_at": "2025-11-19T18:15:51Z",
    "severity": "HIGH"
  },
  "details": "When using Claude Code with Yarn installed, Yarn config files can trigger code execution when running yarn --version. This could lead to a bypass of the directory trust dialog in Claude Code, as plugins and yarnPath could be executed prior to the user accepting the risks of working 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.\n\nThank you to Benjamin Faller, Redguard AG and Michael Hess for reporting this issue!",
  "id": "GHSA-5hhx-v7f6-x7gv",
  "modified": "2025-12-22T16:31:15Z",
  "published": "2025-11-19T20:33:10Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/anthropics/claude-code/security/advisories/GHSA-5hhx-v7f6-x7gv"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-65099"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/anthropics/claude-code"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Claude Code vulnerable to command execution prior to startup trust dialog"
}

GHSA-5HM4-3X9H-JH72

Vulnerability from github – Published: 2022-05-02 00:07 – Updated: 2025-04-09 03:58
VLAI
Details

PHP remote file inclusion vulnerability in manager/static/view.php in phpRealty 0.03 and earlier, and possibly other versions before 0.05, allows remote attackers to execute arbitrary PHP code via a URL in the INC parameter.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2008-4134"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2008-09-19T17:15:00Z",
    "severity": "HIGH"
  },
  "details": "PHP remote file inclusion vulnerability in manager/static/view.php in phpRealty 0.03 and earlier, and possibly other versions before 0.05, allows remote attackers to execute arbitrary PHP code via a URL in the INC parameter.",
  "id": "GHSA-5hm4-3x9h-jh72",
  "modified": "2025-04-09T03:58:29Z",
  "published": "2022-05-02T00:07:10Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2008-4134"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/45181"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/6473"
    },
    {
      "type": "WEB",
      "url": "http://php-realty.com"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/31874"
    },
    {
      "type": "WEB",
      "url": "http://securityreason.com/securityalert/4277"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/31213"
    },
    {
      "type": "WEB",
      "url": "http://www.vupen.com/english/advisories/2008/2611"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-5HM7-X82Q-99RH

Vulnerability from github – Published: 2024-09-10 09:31 – Updated: 2024-09-27 21:31
VLAI
Details

Improper Control of Generation of Code ('Code Injection') in Electron Fuses in Logitech Options Plus version 1.60.496306 on macOS allows attackers to execute arbitrary code via insecure Electron Fuses configuration.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-8258"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-09-10T09:15:07Z",
    "severity": "LOW"
  },
  "details": "Improper Control of Generation of Code (\u0027Code Injection\u0027) in Electron Fuses in Logitech Options Plus version 1.60.496306 on macOS allows attackers to execute arbitrary code via insecure Electron Fuses configuration.",
  "id": "GHSA-5hm7-x82q-99rh",
  "modified": "2024-09-27T21:31:49Z",
  "published": "2024-09-10T09:31:12Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2023-49314"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2023-50643"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-8258"
    },
    {
      "type": "WEB",
      "url": "https://github.com/r3ggi/electroniz3r"
    },
    {
      "type": "WEB",
      "url": "https://www.electronjs.org/docs/latest/tutorial/fuses"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:N/VI:L/VA:L/SC:N/SI:L/SA:L/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:Y/R:U/V:X/RE:X/U:X",
      "type": "CVSS_V4"
    }
  ]
}

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.