{"answers":{"affected":"2 open source packages ship an affected version, including @fastly/js-compute. It affects 1 product.","exploited":"There is no known exploitation of CVE-2022-39218 in the wild and no public exploit code.","fix":"Upgrade @fastly/js-compute to 0.5.3 or later.","what":"CVE-2022-39218 is a high-severity vulnerability in fastly js-compute-runtime, published on 20 Sep 2022. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2022-39218 and fix it if it is affected.\n\nWhat it is: CVE-2022-39218 is a high-severity vulnerability in fastly js-compute-runtime, published on 20 Sep 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2022-39218 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- @fastly/js-compute (npm): affected from 0.4.0; fixed in 0.5.3\n- @fastly/js-compute (npm): affected from 0.4.0; fixed in 0.5.3\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-2022-39218/ (Markdown: https://insights.sbomify.com/CVE-2022-39218/index.md)","id":"CVE-2022-39218","markdown":"https://insights.sbomify.com/CVE-2022-39218/index.md","name":"CVE-2022-39218","record":{"aliases":["GHSA-cmr8-5w4c-44v8"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read","security_bypass"],"network_reachable":"yes","non_default_config":false,"product_category":"Fastly JS Compute Runtime","requires_auth":"none","summary":"Predictable random number generation in Fastly's JS Compute Runtime allows attackers to bypass cryptographic controls and disclose sensitive data.","user_interaction":"not_required","vuln_class":"weak_cryptography"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"js-compute","vendor":"fastly"}],"cvss":{"score":7.5,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","version":"3.1"},"cwes":[{"id":"CWE-335","name":"Incorrect Usage of Seeds in Pseudo-Random Number Generator (PRNG)"}],"description":"The JS Compute Runtime for Fastly's Compute@Edge platform provides the environment JavaScript is executed in when using the Compute@Edge JavaScript SDK. In versions prior to 0.5.3, the `Math.random` and `crypto.getRandomValues` methods fail to use sufficiently random values. The initial value to seed the PRNG (pseudorandom number generator) is baked-in to the final WebAssembly module, making the sequence of random values for that specific WebAssembly module predictable. An attacker can use the fixed seed to predict random numbers generated by these functions and bypass cryptographic security controls, for example to disclose sensitive data encrypted by functions that use these generators. The problem has been patched in version 0.5.3. No known workarounds exist.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Random number seed fixed during compilation","id":"CVE-2022-39218","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"weak_cryptography","year":"2022"},"n_packages":2,"n_references":1,"next":{"headline":"Bifrost users using basic authntication can bypass write permission limit","id":"CVE-2022-39219"},"packages":[{"ecosystem":"npm","fixed":["0.5.3"],"introduced":["0.4.0"],"last_affected":[],"package":"@fastly/js-compute","purl":null,"source":"GHSA-cmr8-5w4c-44v8"},{"ecosystem":"npm","fixed":["0.5.3"],"introduced":["0.4.0"],"last_affected":[],"package":"@fastly/js-compute","purl":"pkg:npm/%40fastly/js-compute","source":"GHSA-cmr8-5w4c-44v8"}],"prev":{"headline":"Improper Neutralization of Formula Elements in a CSV File in ghas-to-csv","id":"CVE-2022-39217"},"products":["js-compute-runtime"],"published":"2022-09-20","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":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-04-23","vendors":["fastly"]},"summary":"Predictable random number generation in Fastly's JS Compute Runtime allows attackers to bypass cryptographic controls and disclose sensitive data.","url":"https://insights.sbomify.com/CVE-2022-39218/"}