github.com/lestrrat-go/jwx vulnerable to Potential Padding Oracle Attack
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- —
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub.
Summary
### Summary Decrypting AES-CBC encrypted JWE has Potential Padding Oracle Attack Vulnerability. ### Details On [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": https://github.com/lestrrat-go/jwx/blob/8840ffd4afc5839f591ff0e9ba9034af52b1643e/jwe/internal/aescbc/aescbc.go#L210-L213 Reporting padding error causes [Padding Oracle Attack](https://en.wikipedia.org/wiki/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. https://github.com/lestrrat-go/jwx/blob/796b2a9101cf7e7cb66455e4d97f3c158ee10904/jwe/internal/aescbc/aescbc.go#L33-L66 To mitigate Timing Attacks, it MUST be done in constant time. ### Impact The authentication tag is verified, so it is not an immediate attack.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | github.com/lestrrat-go/jwx/v2 (Go) | before 2.0.11 | 2.0.11 | Patch available | GHSA-rm8v-mxj3-5rmq |
| — | github.com/lestrrat-go/jwx (Go) | before 1.2.26 | 1.2.26 | Patch available | GHSA-rm8v-mxj3-5rmq |
- github.com/lestrrat-go/jwx/v2 (Go) Vendor— Affected before 2.0.11 Fixed in 2.0.11 Patch available GHSA-rm8v-mxj3-5rmq
- github.com/lestrrat-go/jwx (Go) Vendor— Affected before 1.2.26 Fixed in 1.2.26 Patch available GHSA-rm8v-mxj3-5rmq
Remediation
- Fix · GHSA-rm8v-mxj3-5rmq github.com/lestrrat-go/jwx/v2 (Go) Fixed in 2.0.11 Advisory →
- Fix · GHSA-rm8v-mxj3-5rmq github.com/lestrrat-go/jwx (Go) Fixed in 1.2.26 Advisory →
Timeline
- 2026-10-03 Threatist record created from GHSA-rm8v-mxj3-5rmq
References
Other 6
- https://github.com/lestrrat-go/jwx/security/advisories/GHSA-rm8v-mxj3-5rmq
- https://github.com/lestrrat-go/jwx/commit/6c41e3822485fc7e11dd70b4b0524b075d66b103
- https://github.com/lestrrat-go/jwx/commit/d9ddbc8e5009cfdd8c28413390b67afa7f576dd6
- https://github.com/lestrrat-go/jwx
- https://github.com/lestrrat-go/jwx/blob/796b2a9101cf7e7cb66455e4d97f3c158ee10904/jwe/internal/aescbc/aescbc.go#L33-L66
- https://github.com/lestrrat-go/jwx/blob/8840ffd4afc5839f591ff0e9ba9034af52b1643e/jwe/internal/aescbc/aescbc.go#L210-L213
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences