{"answers":{"affected":"6 open source packages ship an affected version, including github.com/lestrrat-go/jwx and github.com/lestrrat-go/jwx/v2.","exploited":"There is no known exploitation of GHSA-rm8v-mxj3-5rmq in the wild and no public exploit code.","fix":"Upgrade github.com/lestrrat-go/jwx to 1.2.26 or later.","what":"GHSA-rm8v-mxj3-5rmq is a vulnerability in github.com/lestrrat-go/jwx, published on 14 Jun 2023. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-rm8v-mxj3-5rmq and fix it if it is affected.\n\nWhat it is: GHSA-rm8v-mxj3-5rmq is a vulnerability in github.com/lestrrat-go/jwx, published on 14 Jun 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-rm8v-mxj3-5rmq in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- github.com/lestrrat-go/jwx (Go): affected all versions; fixed in 1.2.26\n- github.com/lestrrat-go/jwx (Go): affected all versions; fixed in 1.2.26\n- github.com/lestrrat-go/jwx (Go): affected all versions; fixed in 1.2.26\n- github.com/lestrrat-go/jwx/v2 (Go): affected all versions; fixed in 2.0.11\n- github.com/lestrrat-go/jwx/v2 (Go): affected all versions; fixed in 2.0.11\n- github.com/lestrrat-go/jwx/v2 (Go): affected all versions; fixed in 2.0.11-0.20230614080639-c8b6bec919a1\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/GHSA-rm8v-mxj3-5rmq/ (Markdown: https://insights.sbomify.com/GHSA-rm8v-mxj3-5rmq/index.md)","id":"GHSA-rm8v-mxj3-5rmq","markdown":"https://insights.sbomify.com/GHSA-rm8v-mxj3-5rmq/index.md","name":"GHSA-rm8v-mxj3-5rmq","record":{"aliases":["GO-2023-1859"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read"],"network_reachable":"yes","non_default_config":false,"product_category":"Go JWE library","requires_auth":"none","summary":"The library leaks padding length via timing and error messages during AES-CBC decryption, potentially aiding padding oracle attacks.","user_interaction":"not_required","vuln_class":"weak_cryptography"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### Summary\n\nDecrypting AES-CBC encrypted JWE has Potential Padding Oracle Attack Vulnerability.\n\n### Details\n\nOn [v2.0.10](https://github.com/lestrrat-go/jwx/releases/tag/v2.0.10), decrypting AES-CBC encrypted JWE may return an error \"failed to generate plaintext from decrypted blocks: invalid padding\":\n\nhttps://github.com/lestrrat-go/jwx/blob/8840ffd4afc5839f591ff0e9ba9034af52b1643e/jwe/internal/aescbc/aescbc.go#L210-L213\n\nReporting padding error causes [Padding Oracle Attack](https://en.wikipedia.org/wiki/Padding_oracle_attack) Vulnerability.\nRFC 7516 JSON Web Encryption (JWE) says that we **MUST NOT** do this.\n\n\u003e 11.5.  Timing Attacks\n\u003e To mitigate the attacks described in RFC 3218 [RFC3218], the\n\u003e recipient MUST NOT distinguish between format, padding, and length\n\u003e errors of encrypted keys.  It is strongly recommended, in the event\n\u003e of receiving an improperly formatted key, that the recipient\n\u003e substitute a randomly generated CEK and proceed to the next step, to\n\u003e mitigate timing attacks.\n\nIn addition, the time to remove padding depends on the length of the padding.\nIt may leak the length of the padding by Timing Attacks.\n\nhttps://github.com/lestrrat-go/jwx/blob/796b2a9101cf7e7cb66455e4d97f3c158ee10904/jwe/internal/aescbc/aescbc.go#L33-L66\n\nTo mitigate Timing Attacks, it MUST be done in constant time.\n\n### Impact\n\nThe authentication tag is verified, so it is not an immediate attack.","ecosystems":["Go"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"github.com/lestrrat-go/jwx vulnerable to Potential Padding Oracle Attack","id":"GHSA-rm8v-mxj3-5rmq","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"Go","product":null,"products":[],"type":"weak_cryptography","year":"2023"},"n_packages":6,"n_references":null,"packages":[{"ecosystem":"Go","fixed":["1.2.26"],"introduced":["0"],"last_affected":[],"package":"github.com/lestrrat-go/jwx","purl":null,"source":"GHSA-rm8v-mxj3-5rmq"},{"ecosystem":"Go","fixed":["1.2.26"],"introduced":["0"],"last_affected":[],"package":"github.com/lestrrat-go/jwx","purl":"pkg:golang/github.com/lestrrat-go/jwx","source":"GHSA-rm8v-mxj3-5rmq"},{"ecosystem":"Go","fixed":["1.2.26"],"introduced":["0"],"last_affected":[],"package":"github.com/lestrrat-go/jwx","purl":"pkg:golang/github.com/lestrrat-go/jwx","source":"GO-2023-1859"},{"ecosystem":"Go","fixed":["2.0.11"],"introduced":["0"],"last_affected":[],"package":"github.com/lestrrat-go/jwx/v2","purl":null,"source":"GHSA-rm8v-mxj3-5rmq"},{"ecosystem":"Go","fixed":["2.0.11"],"introduced":["0"],"last_affected":[],"package":"github.com/lestrrat-go/jwx/v2","purl":"pkg:golang/github.com/lestrrat-go/jwx/v2","source":"GHSA-rm8v-mxj3-5rmq"},{"ecosystem":"Go","fixed":["2.0.11-0.20230614080639-c8b6bec919a1"],"introduced":["0"],"last_affected":[],"package":"github.com/lestrrat-go/jwx/v2","purl":"pkg:golang/github.com/lestrrat-go/jwx/v2","source":"GO-2023-1859"}],"products":null,"published":"2023-06-14","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"Go Vulnerability Database","prefix":"GO"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"The library leaks padding length via timing and error messages during AES-CBC decryption, potentially aiding padding oracle attacks.","url":"https://insights.sbomify.com/GHSA-rm8v-mxj3-5rmq/"}