GHSA-rm8v-mxj3-5rmq github.com/lestrrat-go/jwx vulnerable to Potential Padding Oracle Attack
- Published
- Updated
- Exploit status
- No public exploit known
Description
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.
Upgrade path
1 package: 1 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| lestrrat-go github.com/lestrrat-go/jwx/v2(Go) | < 1.2.26; < 2.0.11; < 2.0.11-0.20230614080639-c8b6bec919a1; <= 1.2.25 +1 more | 1.2.26, 2.0.11, 2.0.11-0.20230614080639-c8b6bec919a1 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| lestrrat-go github.com/lestrrat-go/jwx/v2(Go) | <= 2.0.10 | No fix listed |
| lestrrat-go github.com/lestrrat-go/jwx/v2(Go) | <= 1.2.25 | No fix listed |
| lestrrat-go github.com/lestrrat-go/jwx/v2(Go) | < 2.0.11 | 2.0.11 |
| lestrrat-go github.com/lestrrat-go/jwx/v2(Go) | < 1.2.26 | 1.2.26 |
| lestrrat-go github.com/lestrrat-go/jwx/v2(Go) | < 2.0.11-0.20230614080639-c8b6bec919a1 | 2.0.11-0.20230614080639-c8b6bec919a1 |
References
- github.com vendor-advisory
- github.com patch
- github.com patch
- github.com
- github.com
- github.com
- github.com product