@sourceregistry/node-jwt 1.5.9 → 1.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -5
- package/dist/{index-Cp1eA1Xq.js → index-BJnjMyHr.js} +345 -272
- package/dist/index-BJnjMyHr.js.map +1 -0
- package/dist/index-BzmHAEeR.cjs +2 -0
- package/dist/index-BzmHAEeR.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/promises.cjs +1 -1
- package/dist/promises.cjs.map +1 -1
- package/dist/promises.js +2 -2
- package/dist/promises.js.map +1 -1
- package/package.json +1 -1
- package/dist/index-CaEvPIqc.cjs +0 -2
- package/dist/index-CaEvPIqc.cjs.map +0 -1
- package/dist/index-Cp1eA1Xq.js.map +0 -1
package/README.md
CHANGED
|
@@ -207,11 +207,12 @@ See runnable examples in:
|
|
|
207
207
|
## 🛡️ Security Features
|
|
208
208
|
|
|
209
209
|
* ✅ Safe algorithm autodetection
|
|
210
|
-
* ✅
|
|
210
|
+
* ✅ Algorithm/key-type binding prevents HMAC use with asymmetric keys
|
|
211
|
+
* ✅ Strict algorithm whitelisting (`algorithms` must be non-empty when provided)
|
|
211
212
|
* ✅ Full RSASSA-PSS and Ed25519 support
|
|
212
213
|
* ✅ Time claim validation (`exp`, `nbf`, `iat`) with clock skew
|
|
213
214
|
* ✅ Claim validation (`iss`, `sub`, `aud`, `jti`)
|
|
214
|
-
* ✅ Maximum token age enforcement
|
|
215
|
+
* ✅ Maximum token age enforcement (requires `iat`)
|
|
215
216
|
* ✅ Timing-safe signature comparison
|
|
216
217
|
* ✅ Rejects unsupported critical JOSE headers (`crit`)
|
|
217
218
|
* ✅ No insecure defaults
|
|
@@ -234,11 +235,11 @@ const result = verify(token, publicKeyOrSecret, {
|
|
|
234
235
|
|
|
235
236
|
Recommended operational checks:
|
|
236
237
|
|
|
237
|
-
* Pin `algorithms` in every verify call (
|
|
238
|
+
* Pin `algorithms` in every verify call (the list must be non-empty).
|
|
238
239
|
* Always validate `issuer` and `audience` for external tokens.
|
|
239
|
-
* Use short token lifetimes and enforce `maxTokenAge
|
|
240
|
+
* Use short token lifetimes and enforce `maxTokenAge`; tokens must include `iat` when it is configured.
|
|
240
241
|
* Rotate keys regularly and configure JWKS cache `ttl` for your threat model.
|
|
241
|
-
* Monitor and alert on verification failures (`INVALID_SIGNATURE`, `INVALID_CLAIM`, `INVALID_OPTIONS`).
|
|
242
|
+
* Monitor and alert on verification failures (`INVALID_SIGNATURE`, `KEY_ALGORITHM_MISMATCH`, `INVALID_CLAIM`, `INVALID_OPTIONS`).
|
|
242
243
|
|
|
243
244
|
---
|
|
244
245
|
|
|
@@ -296,6 +297,8 @@ This prevents the library from silently accepting JWTs that require header proce
|
|
|
296
297
|
|
|
297
298
|
Includes algorithm whitelist protection and full claim validation.
|
|
298
299
|
|
|
300
|
+
When `maxTokenAge` is configured, the token must include a numeric `iat` claim. `ignoreExpiration`, when used, must be a boolean.
|
|
301
|
+
|
|
299
302
|
**Error Codes include:**
|
|
300
303
|
|
|
301
304
|
* `INVALID_TOKEN`
|