Summary
github.com/lestrrat-go/jwx vulnerable to Potential Padding Oracle Attack
Decrypting AES-CBC encrypted JWE has Potential Padding Oracle Attack Vulnerability.
Details
On v2.0.10, decrypting AES-CBC encrypted JWE may return an error "failed to generate plaintext from decrypted blocks: invalid padding":
Reporting padding error causes Padding Oracle Attack Vulnerability.
RFC 7516 JSON Web Encryption (JWE) says that we MUST NOT do this.
11.5. Timing Attacks
To mitigate the attacks described in RFC 3218 [RFC3218], the
recipient MUST NOT distinguish between format, padding, and length
errors of encrypted keys. It is strongly recommended, in the event
of receiving an improperly formatted key, that the recipient
substitute a randomly generated CEK and proceed to the next step, to
mitigate timing attacks.
In addition, the time to remove padding depends on the length of the padding.
It may leak the length of the padding by Timing Attacks.
To mitigate Timing Attacks, it MUST be done in constant time.
Impact
The authentication tag is verified, so it is not an immediate attack.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
github.com/lestrrat-go/jwx/v2 to 2.0.11 or later; github.com/lestrrat-go/jwx to 1.2.26 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is GHSA-RM8V-MXJ3-5RMQ? GHSA-RM8V-MXJ3-5RMQ is a medium-severity security vulnerability in github.com/lestrrat-go/jwx/v2 (go), affecting versions <= 2.0.10. It is fixed in 2.0.11, 1.2.26.
- Which packages are affected by GHSA-RM8V-MXJ3-5RMQ?
github.com/lestrrat-go/jwx/v2(go) (versions <= 2.0.10)github.com/lestrrat-go/jwx(go) (versions <= 1.2.25)
- Is there a fix for GHSA-RM8V-MXJ3-5RMQ? Yes. GHSA-RM8V-MXJ3-5RMQ is fixed in 2.0.11, 1.2.26. Upgrade to this version or later.
- Is GHSA-RM8V-MXJ3-5RMQ exploitable, and should I be worried? Whether GHSA-RM8V-MXJ3-5RMQ is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-RM8V-MXJ3-5RMQ is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-RM8V-MXJ3-5RMQ?
- Upgrade
github.com/lestrrat-go/jwx/v2to 2.0.11 or later - Upgrade
github.com/lestrrat-go/jwxto 1.2.26 or later
- Upgrade