{"answers":{"affected":"6 open source packages ship an affected version, including lcobucci/jwt. It affects 1 product.","exploited":"There is no known exploitation of CVE-2021-41106 in the wild and no public exploit code.","fix":"Upgrade lcobucci/jwt to a fixed version for your release line: 3.4.6, 4.0.4 or 4.1.5.","what":"CVE-2021-41106 is a medium-severity vulnerability in lcobucci jwt, published on 28 Sep 2021. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2021-41106 and fix it if it is affected.\n\nWhat it is: CVE-2021-41106 is a medium-severity vulnerability in lcobucci jwt, published on 28 Sep 2021. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2021-41106 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- lcobucci/jwt (Packagist): affected from 3.4.0; fixed in 3.4.6\n- lcobucci/jwt (Packagist): affected from 3.4.0; fixed in 3.4.6\n- lcobucci/jwt (Packagist): affected from 4.0.0; fixed in 4.0.4\n- lcobucci/jwt (Packagist): affected from 4.0.0; fixed in 4.0.4\n- lcobucci/jwt (Packagist): affected from 4.1.0; fixed in 4.1.5\n- lcobucci/jwt (Packagist): affected from 4.1.0; fixed in 4.1.5\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-2021-41106/ (Markdown: https://insights.sbomify.com/CVE-2021-41106/index.md)","id":"CVE-2021-41106","markdown":"https://insights.sbomify.com/CVE-2021-41106/index.md","name":"CVE-2021-41106","record":{"aliases":["GHSA-7322-jrq4-x5hf"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["security_bypass"],"network_reachable":"adjacent_or_local","non_default_config":true,"product_category":"PHP JWT library","requires_auth":"low_privilege","summary":"Users relying on file path references for HMAC keys in this JWT library may inadvertently use the path string as the secret, allowing token forgery.","user_interaction":"not_required","vuln_class":"weak_cryptography"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"jwt","vendor":"lcobucci"}],"cvss":{"score":4.4,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N","version":"3.1"},"cwes":[{"id":"CWE-345","name":"Insufficient Verification of Data Authenticity"}],"description":"JWT is a library to work with JSON Web Token and JSON Web Signature. Prior to versions 3.4.6, 4.0.4, and 4.1.5, users of HMAC-based algorithms (HS256, HS384, and HS512) combined with `Lcobucci\\JWT\\Signer\\Key\\LocalFileReference` as key are having their tokens issued/validated using the file path as hashing key - instead of the contents. The HMAC hashing functions take any string as input and, since users can issue and validate tokens, users are lead to believe that everything works properly. Versions 3.4.6, 4.0.4, and 4.1.5 have been patched to always load the file contents, deprecated the `Lcobucci\\JWT\\Signer\\Key\\LocalFileReference`, and suggest `Lcobucci\\JWT\\Signer\\Key\\InMemory` as the alternative. As a workaround, use `Lcobucci\\JWT\\Signer\\Key\\InMemory` instead of `Lcobucci\\JWT\\Signer\\Key\\LocalFileReference` to create the instances of one's keys.","ecosystems":["Packagist"],"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":"File reference keys leads to incorrect hashes on HMAC algorithms","id":"CVE-2021-41106","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Packagist","product":null,"products":[],"type":"weak_cryptography","year":"2021"},"n_packages":6,"n_references":3,"next":{"headline":"LiveQuery publishes user session tokens","id":"CVE-2021-41109"},"packages":[{"ecosystem":"Packagist","fixed":["3.4.6"],"introduced":["3.4.0"],"last_affected":[],"package":"lcobucci/jwt","purl":null,"source":"GHSA-7322-jrq4-x5hf"},{"ecosystem":"Packagist","fixed":["3.4.6"],"introduced":["3.4.0"],"last_affected":[],"package":"lcobucci/jwt","purl":"pkg:composer/lcobucci/jwt","source":"GHSA-7322-jrq4-x5hf"},{"ecosystem":"Packagist","fixed":["4.0.4"],"introduced":["4.0.0"],"last_affected":[],"package":"lcobucci/jwt","purl":null,"source":"GHSA-7322-jrq4-x5hf"},{"ecosystem":"Packagist","fixed":["4.0.4"],"introduced":["4.0.0"],"last_affected":[],"package":"lcobucci/jwt","purl":"pkg:composer/lcobucci/jwt","source":"GHSA-7322-jrq4-x5hf"},{"ecosystem":"Packagist","fixed":["4.1.5"],"introduced":["4.1.0"],"last_affected":[],"package":"lcobucci/jwt","purl":null,"source":"GHSA-7322-jrq4-x5hf"},{"ecosystem":"Packagist","fixed":["4.1.5"],"introduced":["4.1.0"],"last_affected":[],"package":"lcobucci/jwt","purl":"pkg:composer/lcobucci/jwt","source":"GHSA-7322-jrq4-x5hf"}],"prev":{"headline":"FreeSWITCH susceptible to Denial of Service via invalid SRTP packets","id":"CVE-2021-41105"},"products":["jwt"],"published":"2021-09-28","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":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-04","vendors":["lcobucci"]},"summary":"Users relying on file path references for HMAC keys in this JWT library may inadvertently use the path string as the secret, allowing token forgery.","url":"https://insights.sbomify.com/CVE-2021-41106/"}