{"answers":{"affected":"2 open source packages ship an affected version, including json-web-token. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-48238 exists.","fix":"Upgrade json-web-token to 4.0.0 or later.","what":"CVE-2023-48238 is a high-severity vulnerability in joaquimserafim json-web-token, published on 17 Nov 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-48238 and fix it if it is affected.\n\nWhat it is: CVE-2023-48238 is a high-severity vulnerability in joaquimserafim json-web-token, published on 17 Nov 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-48238 exists.\n\nAffected packages and fixed versions:\n- json-web-token (npm): affected all versions; fixed in 4.0.0\n- json-web-token (npm): affected all versions; fixed in 4.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-2023-48238/ (Markdown: https://insights.sbomify.com/CVE-2023-48238/index.md)","id":"CVE-2023-48238","markdown":"https://insights.sbomify.com/CVE-2023-48238/index.md","name":"CVE-2023-48238","record":{"aliases":["GHSA-4xw9-cx39-r355"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["security_bypass"],"network_reachable":"yes","non_default_config":false,"product_category":"JavaScript JWT library","requires_auth":"none","summary":"Attackers can bypass JWT signature verification by exploiting algorithm confusion, allowing unauthorized access to applications using this library.","user_interaction":"not_required","vuln_class":"security_feature_bypass"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"json_web_token","vendor":"joaquimserafim"}],"cvss":{"score":7.5,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-345","name":"Insufficient Verification of Data Authenticity"}],"description":"joaquimserafim/json-web-token is a javascript library use to interact with JSON Web Tokens (JWT) which are a compact URL-safe means of representing claims to be transferred between two parties. Versions prior to 4.0.0 are vulnerable to a JWT algorithm confusion attack. On line 86 of the 'index.js' file, the algorithm to use for verifying the signature of the JWT token is taken from the JWT token, which at that point is still unverified and thus shouldn't be trusted. To exploit this vulnerability, an attacker needs to craft a malicious JWT token containing the HS256 algorithm, signed with the public RSA key of the victim application. This attack will only work against this library is the RS256 algorithm is in use, however it is a best practice to use that algorithm. Version 4.0.0 fixes the issue.","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":"JWT Algorithm Confusion in json-web-token library","id":"CVE-2023-48238","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"security_feature_bypass","year":"2023"},"n_packages":2,"n_references":2,"next":{"headline":"Nextcloud Server users can make external storage mount points inaccessible for other users","id":"CVE-2023-48239"},"packages":[{"ecosystem":"npm","fixed":["4.0.0"],"introduced":["0"],"last_affected":[],"package":"json-web-token","purl":null,"source":"GHSA-4xw9-cx39-r355"},{"ecosystem":"npm","fixed":["4.0.0"],"introduced":["0"],"last_affected":[],"package":"json-web-token","purl":"pkg:npm/json-web-token","source":"GHSA-4xw9-cx39-r355"}],"prev":{"headline":"overflow in shift_line in vim","id":"CVE-2023-48237"},"products":["json-web-token"],"published":"2023-11-17","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":"partial"},"state":"PUBLISHED","updated":"2026-06-08","vendors":["joaquimserafim"]},"summary":"Attackers can bypass JWT signature verification by exploiting algorithm confusion, allowing unauthorized access to applications using this library.","url":"https://insights.sbomify.com/CVE-2023-48238/"}