Releases: cdbattags/lua-resty-jwt
Releases · cdbattags/lua-resty-jwt
Release list
v0.3.2
Bug Fix
- Add missing
resty.utilsmodule to rockspec —lib/resty/utils.lua(added in v0.3.0 for ECDH-ES Concat KDF) was not declared in the LuaRocks rockspec, causingluarocks install lua-resty-jwtto fail at runtime. (Closes #68)
Full Changelog
v0.3.1
Bug Fix
- Fix ECDH-ES Concat KDF for >256-bit content encryption keys — The Concat KDF (RFC 7518 §4.6.2) only performed a single SHA-256 round (256 bits), which broke ECDH-ES direct key agreement with
A192CBC-HS384(384-bit) andA256CBC-HS512(512-bit) content encryption. Now correctly iteratesceil(keydatalen / 256)rounds.
Testing
- 21 new JWE test cases covering previously untested algorithm combinations:
dir+ GCM modes (A128GCM, A192GCM, A256GCM, A192CBC-HS384)ECDH-ES+ CBC-HS modes (A128CBC-HS256, A192CBC-HS384, A256CBC-HS512)ECDH-ESandECDH-ES+A256KWwith P-384 curve- Wrong key/password rejection for all key management families (dir, AES-KW, AES-GCMKW, RSA-OAEP, PBES2, ECDH-ES)
- JWE claim validation (exp/nbf)
- Invalid key length and unsupported algorithm rejection
- 858 tests passing (up from 795)
Coverage Tooling
- Added
luacovsupport gated behindCOVERAGE=1env var - New
ci-coveragescript for line-level coverage reports - Current coverage: 87% overall (89% jwt.lua, 99% jwt-validators.lua, 100% utils.lua)
Full Changelog
v0.3.0
Full IANA JOSE Algorithm Coverage
This release brings lua-resty-jwt to complete coverage of the IANA JSON Object Signing and Encryption algorithm registry (excluding deprecated RSA1_5 and insecure none).
New Algorithms
JWS Signing (RFC 7518 / RFC 8037)
| Family | Algorithms |
|---|---|
| HMAC | HS384 |
| RSASSA-PKCS1 | RS384 |
| RSASSA-PSS | PS256, PS384, PS512 |
| ECDSA | ES384 |
| EdDSA | Ed25519, Ed448 |
JWE Key Management (RFC 7518)
| Family | Algorithms |
|---|---|
| RSA-OAEP | RSA-OAEP (SHA-1), RSA-OAEP-384, RSA-OAEP-512 |
| AES Key Wrap | A192KW |
| AES-GCM Key Wrap | A128GCMKW, A192GCMKW, A256GCMKW |
| ECDH-ES Key Agreement | ECDH-ES, ECDH-ES+A128KW, ECDH-ES+A192KW, ECDH-ES+A256KW |
| Password-Based (PBES2) | PBES2-HS256+A128KW, PBES2-HS384+A192KW, PBES2-HS512+A256KW |
JWE Content Encryption (RFC 7518)
| Family | Algorithms |
|---|---|
| AES-CBC + HMAC | A192CBC-HS384 |
| AES-GCM | A128GCM, A192GCM |
Bug Fixes
- Fix non-JSON payloads rejected during JWS verification
- Fix const-correctness in FFI declaration for
d2i_ECDSA_SIG - Fix undeclared local
_in JWE functions - Guard against nil payload in claim validation
CI / Testing
- Parallel test execution with
prove -j4(unique servroot + port per process) - Drop
repeat_each(2)— tests are deterministic, no need to double - 795 tests passing in ~20s (down from ~100s)
- Simplified
ciscript, deduplicated test workflow
Documentation
- Document
set_alg_whitelistand update supported algorithms list
Full Changelog
v0.2.4
Security
- Authentication bypass via JWE header confusion (CVE-2024-33531)
- Malformed JWTs with JWE-like headers could bypass signature verification
- Parser now tags tokens by structural type (
JWTvsJWE) during parsing - Prevents header-based routing confusion in
signandverify_jwt_obj
Bug Fixes
- RSA-OAEP-256 JWE broken on OpenSSL 3.x
EVP_PKEY_CTX_ctrlwithEVP_PKEY_CTRL_RSA_OAEP_MDreturns -1 on the 3.x compat shim- Uses the real
EVP_PKEY_CTX_set_rsa_oaep_mdfunction when available - Falls back to the ctrl path for OpenSSL 1.1.x
- Fixes all 8 RSA-OAEP-256 JWE test failures on OpenSSL 3.x
- JWTs with missing
algheader- Now properly rejected instead of silently passing verification
CI/CD
- Replace Travis CI with GitHub Actions
- Test workflow on push/PR to master
- LuaRocks + OPM publish workflow on release (gated on tests)
- Modernize test infrastructure
openresty-testsuiteDocker image upgraded to Debian Bookworm + OpenResty 1.27.1.2 + OpenSSL 3.x- Multi-arch support (amd64 + arm64)
- Dependency updates
lua-resty-hmacsubmodule updated to v0.06dist.iniOPM deps aligned:lua-resty-hmac >= 0.06,lua-resty-openssl >= 0.6.8