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.

8402 vulnerabilities reference this CWE, most recent first.

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

GHSA-5HP9-W6MM-8MQ6

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

WebKit in Apple Safari before 5.0.3 on Mac OS X 10.5 through 10.6 and Windows, and before 4.1.3 on Mac OS X 10.4, does not properly perform a cast of an unspecified variable during processing of editing commands, which allows remote attackers to execute arbitrary code or cause a denial of service (application crash) via a crafted web site.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2010-3808"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2010-11-22T13:00:00Z",
    "severity": "HIGH"
  },
  "details": "WebKit in Apple Safari before 5.0.3 on Mac OS X 10.5 through 10.6 and Windows, and before 4.1.3 on Mac OS X 10.4, does not properly perform a cast of an unspecified variable during processing of editing commands, which allows remote attackers to execute arbitrary code or cause a denial of service (application crash) via a crafted web site.",
  "id": "GHSA-5hp9-w6mm-8mq6",
  "modified": "2022-05-17T01:03:48Z",
  "published": "2022-05-17T01:03:48Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2010-3808"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/63349"
    },
    {
      "type": "WEB",
      "url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A12160"
    },
    {
      "type": "WEB",
      "url": "http://lists.apple.com/archives/security-announce/2010//Nov/msg00002.html"
    },
    {
      "type": "WEB",
      "url": "http://lists.apple.com/archives/security-announce/2010//Nov/msg00003.html"
    },
    {
      "type": "WEB",
      "url": "http://lists.opensuse.org/opensuse-security-announce/2011-01/msg00006.html"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/42314"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/43068"
    },
    {
      "type": "WEB",
      "url": "http://support.apple.com/kb/HT4455"
    },
    {
      "type": "WEB",
      "url": "http://support.apple.com/kb/HT4456"
    },
    {
      "type": "WEB",
      "url": "http://www.vupen.com/english/advisories/2010/3046"
    },
    {
      "type": "WEB",
      "url": "http://www.vupen.com/english/advisories/2011/0212"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-5HV4-9F73-FVRJ

Vulnerability from github – Published: 2026-07-24 18:31 – Updated: 2026-07-24 18:31
VLAI
Details

Microweber CMS through 2.0.20 contains a server-side template injection vulnerability that allows authenticated administrators to achieve arbitrary OS command execution by injecting Twig expressions into mail templates. Attackers can exploit the unsandboxed Twig environment in TwigView::render(), which lacks SandboxExtension or a SecurityPolicy, to inject malicious expressions such as filter('system') into mail template bodies stored unsanitized in the database, causing automatic payload execution on each subsequent application event that triggers a mail dispatch.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-65693"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-07-24T16:16:55Z",
    "severity": "HIGH"
  },
  "details": "Microweber CMS through 2.0.20 contains a server-side template injection vulnerability that allows authenticated administrators to achieve arbitrary OS command execution by injecting Twig expressions into mail templates. Attackers can exploit the unsandboxed Twig environment in TwigView::render(), which lacks SandboxExtension or a SecurityPolicy, to inject malicious expressions such as filter(\u0027system\u0027) into mail template bodies stored unsanitized in the database, causing automatic payload execution on each subsequent application event that triggers a mail dispatch.",
  "id": "GHSA-5hv4-9f73-fvrj",
  "modified": "2026-07-24T18:31:29Z",
  "published": "2026-07-24T18:31:29Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-65693"
    },
    {
      "type": "WEB",
      "url": "https://gist.github.com/W40X/584f4b088d310bc5280cc74bbf97831a"
    },
    {
      "type": "WEB",
      "url": "https://www.vulncheck.com/advisories/microweber-cms-server-side-template-injection-via-mail-templates"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/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-5HV6-MH8Q-Q9V8

Vulnerability from github – Published: 2020-10-16 16:55 – Updated: 2021-11-19 14:41
VLAI
Summary
RCE in XWiki
Details

Impact

Any user with SCRIPT right (EDIT right before XWiki 7.4) can gain access to the application server Servlet context which contains tools allowing to instantiate arbitrary Java objects and invoke methods that may lead to arbitrary code execution.

Patches

It has been patched in both version XWiki 12.5 and XWiki 11.10.6.

Workarounds

The only workaround is to give SCRIPT right only to trusted users.

References

https://jira.xwiki.org/browse/XWIKI-17423

It's been reported by the GitHub Security Lab under https://jira.xwiki.org/browse/XWIKI-17141.

For more information

If you have any questions or comments about this advisory: * Open an issue in Jira XWiki * Email us at our security mailing list

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Maven",
        "name": "org.xwiki.platform:xwiki-platform-oldcore"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "11.10.6"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Maven",
        "name": "org.xwiki.platform:xwiki-platform-oldcore"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "12.0"
            },
            {
              "fixed": "12.5"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2020-15252"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-74",
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2020-10-16T16:55:27Z",
    "nvd_published_at": "2020-10-16T17:15:00Z",
    "severity": "HIGH"
  },
  "details": "### Impact\n\nAny user with SCRIPT right (EDIT right before XWiki 7.4) can gain access to the application server Servlet context which contains tools allowing to instantiate arbitrary Java objects and invoke methods that may lead to arbitrary code execution.\n\n### Patches\n\nIt has been patched in both version XWiki 12.5 and XWiki 11.10.6.\n\n### Workarounds\n\nThe only workaround is to give SCRIPT right only to trusted users.\n\n### References\n\nhttps://jira.xwiki.org/browse/XWIKI-17423\n\nIt\u0027s been reported by the GitHub Security Lab under https://jira.xwiki.org/browse/XWIKI-17141.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [Jira XWiki](https://jira.xwiki.org)\n* Email us at [our security mailing list](mailto:security@xwiki.org)",
  "id": "GHSA-5hv6-mh8q-q9v8",
  "modified": "2021-11-19T14:41:16Z",
  "published": "2020-10-16T16:55:49Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-5hv6-mh8q-q9v8"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2020-15252"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/xwiki/xwiki-platform"
    },
    {
      "type": "WEB",
      "url": "https://jira.xwiki.org/browse/XWIKI-17141"
    },
    {
      "type": "WEB",
      "url": "https://jira.xwiki.org/browse/XWIKI-17423"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "RCE in XWiki"
}

GHSA-5HV7-69VG-96RR

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

This affects the package MintegralAdSDK before 6.6.0.0. The SDK distributed by the company contains malicious functionality that acts as a backdoor. Mintegral and their partners (advertisers) can remotely execute arbitrary code on a user device.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2020-7745"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2020-10-19T10:15:00Z",
    "severity": "HIGH"
  },
  "details": "This affects the package MintegralAdSDK before 6.6.0.0. The SDK distributed by the company contains malicious functionality that acts as a backdoor. Mintegral and their partners (advertisers) can remotely execute arbitrary code on a user device.",
  "id": "GHSA-5hv7-69vg-96rr",
  "modified": "2022-05-24T17:31:21Z",
  "published": "2022-05-24T17:31:21Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2020-7745"
    },
    {
      "type": "WEB",
      "url": "https://snyk.io/blog/remote-code-execution-rce-sourmint"
    },
    {
      "type": "WEB",
      "url": "https://snyk.io/research/sour-mint-malicious-sdk/%23rce"
    },
    {
      "type": "WEB",
      "url": "https://snyk.io/vuln/SNYK-COCOAPODS-MINTEGRALADSDK-1019377"
    },
    {
      "type": "WEB",
      "url": "https://www.youtube.com/watch?v=n-mEMkeoUqs"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-5J35-3RHC-CV6R

Vulnerability from github – Published: 2025-06-06 15:30 – Updated: 2026-04-01 18:35
VLAI
Details

Improper Control of Generation of Code ('Code Injection') vulnerability in cmoreira Team Showcase allows Code Injection. This issue affects Team Showcase: from n/a through n/a.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-49250"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-06-06T13:15:42Z",
    "severity": "MODERATE"
  },
  "details": "Improper Control of Generation of Code (\u0027Code Injection\u0027) vulnerability in cmoreira Team Showcase allows Code Injection. This issue affects Team Showcase: from n/a through n/a.",
  "id": "GHSA-5j35-3rhc-cv6r",
  "modified": "2026-04-01T18:35:22Z",
  "published": "2025-06-06T15:30:49Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-49250"
    },
    {
      "type": "WEB",
      "url": "https://patchstack.com/database/wordpress/plugin/team-showcase-cm/vulnerability/wordpress-team-showcase-plugin-25-05-13-arbitrary-shortcode-execution-vulnerability?_s_id=cve"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-5J3G-JFQ3-7JWX

Vulnerability from github – Published: 2017-10-24 18:33 – Updated: 2021-09-01 22:16
VLAI
Summary
Arbitrary JavaScript Execution in bassmaster
Details

A vulnerability exists in bassmaster <= 1.5.1 that allows for an attacker to provide arbitrary JavaScript that is then executed server side via eval.

Recommendation

Update to bassmaster version 1.5.2 or greater.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "bassmaster"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.5.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2014-7205"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2020-06-16T21:16:29Z",
    "nvd_published_at": null,
    "severity": "CRITICAL"
  },
  "details": "A vulnerability exists in bassmaster \u003c= 1.5.1 that allows for an attacker to provide arbitrary JavaScript that is then executed server side via eval.\n\n\n## Recommendation\n\nUpdate to bassmaster version 1.5.2 or greater.",
  "id": "GHSA-5j3g-jfq3-7jwx",
  "modified": "2021-09-01T22:16:02Z",
  "published": "2017-10-24T18:33:36Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2014-7205"
    },
    {
      "type": "WEB",
      "url": "https://github.com/hapijs/bassmaster/commit/b751602d8cb7194ee62a61e085069679525138c4"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/96730"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/advisories/GHSA-5j3g-jfq3-7jwx"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/hapijs/bassmaster"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/40689"
    },
    {
      "type": "WEB",
      "url": "https://www.npmjs.com/advisories/1"
    },
    {
      "type": "WEB",
      "url": "http://www.openwall.com/lists/oss-security/2014/09/30/10"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/70180"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [],
  "summary": "Arbitrary JavaScript Execution in bassmaster"
}

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.