{"answers":{"affected":"12 open source packages ship an affected version, including ses. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-39532 exists.","fix":"Upgrade ses to a fixed version for your release line: 0.13.5, 0.14.5, 0.15.24 or 0.16.1.","what":"CVE-2023-39532 is a critical code injection vulnerability in endojs endo, published on 8 Aug 2023. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2023-39532 and fix it if it is affected.\n\nWhat it is: CVE-2023-39532 is a critical code injection vulnerability in endojs endo, published on 8 Aug 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-39532 exists.\n\nAffected packages and fixed versions:\n- ses (npm): affected from 0.13.0; fixed in 0.13.5\n- ses (npm): affected from 0.13.0; fixed in 0.13.5\n- ses (npm): affected from 0.14.0; fixed in 0.14.5\n- ses (npm): affected from 0.14.0; fixed in 0.14.5\n- ses (npm): affected from 0.15.0; fixed in 0.15.24\n- ses (npm): affected from 0.15.0; fixed in 0.15.24\n- ses (npm): affected from 0.16.0; fixed in 0.16.1\n- ses (npm): affected from 0.16.0; fixed in 0.16.1\n- ses (npm): affected from 0.17.0; fixed in 0.17.1\n- ses (npm): affected from 0.17.0; fixed in 0.17.1\n- ses (npm): affected from 0.18.0; fixed in 0.18.7\n- ses (npm): affected from 0.18.0; fixed in 0.18.7\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2023-39532/ (Markdown: https://insights.sbomify.com/CVE-2023-39532/index.md)","id":"CVE-2023-39532","markdown":"https://insights.sbomify.com/CVE-2023-39532/index.md","name":"CVE-2023-39532","record":{"aliases":["GHSA-9c4h-3f7h-322r"],"analysis":{"component_type":"library","fix_type":"patch","impacts":["code_execution","data_read"],"network_reachable":"yes","non_default_config":false,"product_category":"JavaScript sandbox library","requires_auth":"none","summary":"Attackers can bypass SES sandbox confinement via dynamic import to execute arbitrary code or exfiltrate data in Node.js or web environments.","user_interaction":"not_required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"ses","vendor":"agoric"}],"cvss":{"score":9.8,"severity":"critical","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-20","name":"Improper Input Validation"}],"description":"SES is a JavaScript environment that allows safe execution of arbitrary programs in Compartments. In version 0.18.0 prior to 0.18.7, 0.17.0 prior to 0.17.1, 0.16.0 prior to 0.16.1, 0.15.0 prior to 0.15.24, 0.14.0 prior to 0.14.5, an 0.13.0 prior to 0.13.5, there is a hole in the confinement of guest applications under SES that may manifest as either the ability to exfiltrate information or execute arbitrary code depending on the configuration and implementation of the surrounding host.\n\nGuest program running inside a Compartment with as few as no endowments can gain access to the surrounding host’s dynamic import by using dynamic import after the spread operator, like `{...import(arbitraryModuleSpecifier)}`.\n\nOn the web or in web extensions, a Content-Security-Policy following ordinary best practices likely mitigates both the risk of exfiltration and execution of arbitrary code, at least limiting the modules that the attacker can import to those that are already part of the application. However, without a Content-Security-Policy, dynamic import can be used to issue HTTP requests for either communication through the URL or for the execution of code reachable from that origin.\n\nWithin an XS worker, an attacker can use the host’s module system to the extent that the host has been configured. This typically only allows access to module code on the host’s file system and is of limited use to an attacker.\n\nWithin Node.js, the attacker gains access to Node.js’s module system. Importing the powerful builtins is not useful except insofar as there are side-effects and tempered because dynamic import returns a promise. Spreading a promise into an object renders the promises useless. However, Node.js allows importing data URLs, so this is a clear path to arbitrary execution.\n\nVersions 0.18.7, 0.17.1, 0.16.1, 0.15.24, 0.14.5, and 0.13.5 contain a patch for this issue. Some workarounds are available. On the web, providing a suitably constrained Content-Security-Policy mitigates most of the threat. With XS, building a binary that lacks the ability to load modules at runtime mitigates the entirety of the threat. That will look like an implementation of `fxFindModule` in a file like `xsPlatform.c` that calls `fxRejectModuleFile`.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"SES's dynamic import and spread operator provides possible path to arbitrary exfiltration and execution","id":"CVE-2023-39532","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"code_injection","year":"2023"},"n_packages":12,"n_references":2,"next":{"headline":"libp2p nodes vulnerable to attack using large RSA keys","id":"CVE-2023-39533"},"packages":[{"ecosystem":"npm","fixed":["0.13.5"],"introduced":["0.13.0"],"last_affected":[],"package":"ses","purl":null,"source":"GHSA-9c4h-3f7h-322r"},{"ecosystem":"npm","fixed":["0.13.5"],"introduced":["0.13.0"],"last_affected":[],"package":"ses","purl":"pkg:npm/ses","source":"GHSA-9c4h-3f7h-322r"},{"ecosystem":"npm","fixed":["0.14.5"],"introduced":["0.14.0"],"last_affected":[],"package":"ses","purl":null,"source":"GHSA-9c4h-3f7h-322r"},{"ecosystem":"npm","fixed":["0.14.5"],"introduced":["0.14.0"],"last_affected":[],"package":"ses","purl":"pkg:npm/ses","source":"GHSA-9c4h-3f7h-322r"},{"ecosystem":"npm","fixed":["0.15.24"],"introduced":["0.15.0"],"last_affected":[],"package":"ses","purl":null,"source":"GHSA-9c4h-3f7h-322r"},{"ecosystem":"npm","fixed":["0.15.24"],"introduced":["0.15.0"],"last_affected":[],"package":"ses","purl":"pkg:npm/ses","source":"GHSA-9c4h-3f7h-322r"},{"ecosystem":"npm","fixed":["0.16.1"],"introduced":["0.16.0"],"last_affected":[],"package":"ses","purl":null,"source":"GHSA-9c4h-3f7h-322r"},{"ecosystem":"npm","fixed":["0.16.1"],"introduced":["0.16.0"],"last_affected":[],"package":"ses","purl":"pkg:npm/ses","source":"GHSA-9c4h-3f7h-322r"},{"ecosystem":"npm","fixed":["0.17.1"],"introduced":["0.17.0"],"last_affected":[],"package":"ses","purl":null,"source":"GHSA-9c4h-3f7h-322r"},{"ecosystem":"npm","fixed":["0.17.1"],"introduced":["0.17.0"],"last_affected":[],"package":"ses","purl":"pkg:npm/ses","source":"GHSA-9c4h-3f7h-322r"},{"ecosystem":"npm","fixed":["0.18.7"],"introduced":["0.18.0"],"last_affected":[],"package":"ses","purl":null,"source":"GHSA-9c4h-3f7h-322r"},{"ecosystem":"npm","fixed":["0.18.7"],"introduced":["0.18.0"],"last_affected":[],"package":"ses","purl":"pkg:npm/ses","source":"GHSA-9c4h-3f7h-322r"}],"prev":{"headline":"Sentry vulnerable to incorrect credential validation on OAuth token requests","id":"CVE-2023-39531"},"products":["endo"],"published":"2023-08-08","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"poc","technical_impact":"total"},"state":"PUBLISHED","updated":"2024-10-10","vendors":["endojs"]},"summary":"Attackers can bypass SES sandbox confinement via dynamic import to execute arbitrary code or exfiltrate data in Node.js or web environments.","url":"https://insights.sbomify.com/CVE-2023-39532/"}