🐛 Fix JWKS key length to meet RS512 requirements#28208
Conversation
The RS512 algorithm specification requires an RSA key modulus length of 2048 bits or larger. The member token service generates its JWTs using RS512 but the fallback auto-generated keys (used for token signing and exposed at `/members/.well-known/jwks.json`) were using a 1024-bit key length. This updates the dynamically generated RSA keys for members to 2048 bits to comply with the standard and resolve validation errors when external libraries try to parse the member token keys. Fixes TryGhost#24831
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis pull request upgrades RSA keypair generation from 1024-bit to 2048-bit keys across the member authentication system. The changes affect two locations: the lazy-initialized keypair generators for Members and Ghost keys in the settings model, and the fallback keypair generation in the Members configuration provider when API keys are missing. Both changes apply the same bit-size upgrade to ensure RSA keys meet the RS512 JWT specification requirement of 2048-bit minimum key length. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The RS512 algorithm specification requires an RSA key modulus length of 2048 bits or larger. The member token service generates its JWTs using RS512 but the fallback auto-generated keys (used for token signing and exposed at
/members/.well-known/jwks.json) were using a 1024-bit key length.This updates the dynamically generated RSA keys for members to 2048 bits to comply with the standard and resolve validation errors when external libraries try to parse the member token keys.
Fixes #24831