Executive brief
jose-browser-runtime is a JavaScript library for handling JSON Web Encryption (JWE) tokens in web browsers. A timing-based side-channel vulnerability allows an attacker to decrypt JWE messages encrypted with AES-CBC-HMAC algorithms without knowing the decryption key by observing execution time differences during decryption failures. An attacker can exploit this weakness to recover sensitive encrypted data, such as authentication tokens or session information, through repeated decryption attempts.
Technical details
The vulnerability is a padding oracle attack arising from observable timing discrepancies in the AES_CBC_HMAC_SHA2 decryption algorithm (A128CBC-HS256, A192CBC-HS384, A256CBC-HS512). The vulnerable code performs HMAC tag verification and CBC decryption in a specific order without constant-time comparison, causing measurable timing differences when padding validation fails versus when HMAC verification fails. An attacker with network access to a service using the library can issue crafted JWE payloads and measure response times to determine correct padding byte-by-byte, enabling full decryption without the key (approximately 128*b queries needed where b is the ciphertext block size). The fix ensures HMAC verification is performed before CBC decryption and uses constant-time comparison. Patched in version 3.11.4 and later.
Affected products
- Jose jose-browser-runtime < 3.11.4
Timeline
- 2021-04-15: disclosed
- 2021-04-15: patched: Fixed in version 3.11.4