This patch release strengthens ciphertext and signed-message validation while preserving support for existing valid encrypted values.
Security
- Enforce full-length AES-GCM authentication tags and canonical nonce sizes.
- Bind new AES-GCM and ChaCha20-Poly1305 ciphertexts to their algorithm and encrypter ID using HKDF-derived keys.
- Reject non-canonical Base64URL values and encrypted payloads containing unexpected segments.
- Reject empty or insecure
MessageVerifiersecrets.
Fixes
- Throw an explicit error when configuring an empty key list.
- Throw an explicit error when requesting an unknown encrypter.
- Update
base64UrlDecodetypes to correctly expose its nullable result.
Compatibility
Existing valid AES-GCM, ChaCha20-Poly1305, AES-CBC, AES-SIV, and signed-message values remain readable, including purpose-bound values and values encrypted before key rotation.
New AES-GCM and ChaCha20-Poly1305 ciphertexts use the v1: marker. During rolling deployments, update all readers before allowing updated instances to produce new ciphertexts, since previous library versions cannot read the new format.
Malformed payloads and configurations using secrets shorter than 16 characters are now intentionally rejected.
Commits
- style: fix linting error (d8b90ea)
- fix: harden message verification (dfc7eac)
- fix: reject malformed encoded payloads (eab450c)
- fix: harden authenticated encryption drivers (820b5b8)
- chore: add minimal age gate (540376d)
- chore(deps): update dependency release-it to v20 (#39) (66f4278)
- chore(deps): update all non-major dependencies (#41) (de16b98)
- chore(deps): update all non-major dependencies (#40) (a1dd3fb)
- chore(deps): update all non-major dependencies (#38) (55e9496)
- chore(deps): update all non-major dependencies (#36) (7da8bfe)
- chore(deps): update dependency eslint to v10 (#34) (a2ccb17)
- fix(deps): update all non-major dependencies (#33) (40368c7)
- chore(deps): update dependency c8 to v11 (#35) (d29d73b)
- fix: throw explicit error when using unknown encrypter (4b8ae55)
- fix: validate non-empty key arrays and add regression tests (5e226bd)
- docs(readme): update branch name (6b0814f)