{"answers":{"affected":"2 open source packages ship an affected version, including jsonwebtoken. It affects 1 product.","exploited":"There is no known exploitation of CVE-2022-23540 in the wild and no public exploit code.","fix":"Upgrade jsonwebtoken to 9.0.0 or later.","what":"CVE-2022-23540 is a medium-severity authentication bypass vulnerability in auth0 node-jsonwebtoken, published on 22 Dec 2022. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2022-23540 and fix it if it is affected.\n\nWhat it is: CVE-2022-23540 is a medium-severity authentication bypass vulnerability in auth0 node-jsonwebtoken, published on 22 Dec 2022. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2022-23540 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- jsonwebtoken (npm): affected all versions; fixed in 9.0.0\n- jsonwebtoken (npm): affected all versions; fixed in 9.0.0\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-23540/ (Markdown: https://insights.sbomify.com/CVE-2022-23540/index.md)","id":"CVE-2022-23540","markdown":"https://insights.sbomify.com/CVE-2022-23540/index.md","name":"CVE-2022-23540","record":{"aliases":["CLSA-2026-1784683085","CLSA-2026-1784769530","GHSA-qwph-4952-7xr6","ROOT-APP-NPM-CVE-2022-23540"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["security_bypass","account_takeover"],"network_reachable":"yes","non_default_config":false,"product_category":"Node.js JWT library","requires_auth":"low_privilege","summary":"Attackers can bypass JWT signature validation by exploiting the default 'none' algorithm, allowing unauthorized access if algorithms are not explicitly specified.","user_interaction":"not_required","vuln_class":"auth_bypass"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"jsonwebtoken","vendor":"auth0"}],"cvss":{"score":6.4,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:H/A:L","version":"3.1"},"cwes":[{"id":"CWE-347","name":"Improper Verification of Cryptographic Signature"},{"id":"CWE-287","name":"Improper Authentication"}],"description":"In versions `\u003c=8.5.1` of `jsonwebtoken` library, lack of algorithm definition in the `jwt.verify()` function can lead to signature validation bypass due to defaulting to the `none` algorithm for signature verification. Users are affected if you do not specify algorithms in the `jwt.verify()` function. This issue has been fixed, please update to version 9.0.0 which removes the default support for the none algorithm in the `jwt.verify()` method. There will be no impact, if you update to version 9.0.0 and you don’t need to allow for the `none` algorithm. If you need 'none' algorithm, you have to explicitly specify that in `jwt.verify()` options.","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":"jsonwebtoken vulnerable to signature validation bypass due to insecure default algorithm in jwt.verify()","id":"CVE-2022-23540","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"auth_bypass","year":"2022"},"n_packages":2,"n_references":3,"next":{"headline":"jsonwebtoken's insecure implementation of key retrieval function could lead to Forgeable Public/Private Tokens from RSA to HMAC","id":"CVE-2022-23541"},"packages":[{"ecosystem":"npm","fixed":["9.0.0"],"introduced":["0"],"last_affected":[],"package":"jsonwebtoken","purl":null,"source":"GHSA-qwph-4952-7xr6"},{"ecosystem":"npm","fixed":["9.0.0"],"introduced":["0"],"last_affected":[],"package":"jsonwebtoken","purl":"pkg:npm/jsonwebtoken","source":"GHSA-qwph-4952-7xr6"}],"prev":{"headline":"jsonwebtoken unrestricted key type could lead to legacy keys usage","id":"CVE-2022-23539"},"products":["node-jsonwebtoken"],"published":"2022-12-22","related":[{"cvss_score":9.8,"headline":"Verification Bypass in jsonwebtoken","id":"CVE-2015-9235","kev_date_added":null,"published":"2018-05-29"},{"cvss_score":5.9,"headline":"jsonwebtoken unrestricted key type could lead to legacy keys usage","id":"CVE-2022-23539","kev_date_added":null,"published":"2022-12-22"},{"cvss_score":5,"headline":"jsonwebtoken's insecure implementation of key retrieval function could lead to Forgeable Public/Private Tokens from RSA to HMAC","id":"CVE-2022-23541","kev_date_added":null,"published":"2022-12-22"}],"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":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-02-13","vendors":["auth0"]},"summary":"Attackers can bypass JWT signature validation by exploiting the default 'none' algorithm, allowing unauthorized access if algorithms are not explicitly specified.","url":"https://insights.sbomify.com/CVE-2022-23540/"}