GHSA-rm8v-mxj3-5rmq
github.com/lestrrat-go/jwx vulnerable to Potential Padding Oracle Attack
Summary
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.
What each source reports
GitHub AdvisoriesNo score
github.com/lestrrat-go/jwx vulnerable to Potential Padding Oracle Attack
Summary
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.
- Record
GHSA-rm8v-mxj3-5rmq- Updated
- 2026-11-02
OSVNo score
github.com/lestrrat-go/jwx vulnerable to Potential Padding Oracle Attack
Summary
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.
- Record
GHSA-rm8v-mxj3-5rmq- Updated
- 2026-11-02
OSVGO-2023-1859No score
Padding oracle vulnerability in github.com/lestrrat-go/jwx
AES-CBC decryption is vulnerable to a timing attack which may permit an attacker to recover the plaintext of JWE data.
- Record
GO-2023-1859- Updated
- 2026-11-02
Affected packages
| Package | Affected | Fixed |
|---|---|---|
github.com/lestrrat-go/jwx/v2Go | through 2.0.10 | 2.0.11 |
github.com/lestrrat-go/jwxGo | through 1.2.25 | 1.2.26 |
github.com/lestrrat-go/jwx/v2Go | before 2.0.11 | 2.0.11 |
github.com/lestrrat-go/jwxGo | before 1.2.26 | 1.2.26 |
github.com/lestrrat-go/jwx/v2Go | before 2.0.11-0.20230614080639-c8b6bec919a1 | 2.0.11-0.20230614080639-c8b6bec919a1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | GitHub Advisories, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
GHSA-rm8v-mxj3-5rmq is a vulnerability with no CVSS score yet in github.com/lestrrat-go/jwx, published June 14, 2023. No source lists public exploit code. Fixed in github.com/lestrrat-go/jwx/v2 2.0.11.
References
github.com/lestrrat-go/jwx/security/advisories/GHSA-rm8v-mxj3-5rmq
github.com/lestrrat-go/jwx/commit/6c41e3822485fc7e11dd70b4b0524b075d66b103
github.com/lestrrat-go/jwx/commit/d9ddbc8e5009cfdd8c28413390b67afa7f576dd6
github.com/lestrrat-go/jwx/blob/796b2a9101cf7e7cb66455e4d97f3c158ee10904/jwe/internal/aescbc/aescbc.go
github.com/lestrrat-go/jwx/blob/8840ffd4afc5839f591ff0e9ba9034af52b1643e/jwe/internal/aescbc/aescbc.go
github.com/advisories/GHSA-rm8v-mxj3-5rmq
github.com/lestrrat-go/jwx