Repository navigation
Use RSA 2048-bit keys in json-crypto/json-web-token tests (CodeQL java/insufficient-key-size) - #200
Merged
vharseko merged 1 commit intoJul 16, 2026
Conversation
…a/insufficient-key-size) RsaJWKTest and JsonCryptoTest generated ephemeral RSA key pairs with a 1024-bit modulus, which CodeQL flags as below the recommended 2048-bit minimum (CWE-326). The keys are throwaway test fixtures with no production impact, but bumping them to 2048 bits removes the finding and keeps the test crypto aligned with current best practice. The tests assert round-trip properties (modulus/exponent, JWK encode/decode, encrypt/decrypt) that are independent of key size, so they pass unchanged. Fixes code-scanning alerts OpenIdentityPlatform#17, OpenIdentityPlatform#18, OpenIdentityPlatform#19, OpenIdentityPlatform#20.
maximthomas
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes CodeQL code-scanning alerts #17, #18, #19, #20 (
java/insufficient-key-size, high / CWE-326).RsaJWKTestandJsonCryptoTestgenerated ephemeral RSA key pairs with a 1024-bit modulus, which CodeQL flags as below the recommended 2048-bit minimum.Change
Bump the RSA key size from 1024 to 2048 bits at all four test key-generation sites:
json-crypto/core—JsonCryptoTest#beforeClassjson-web-token—RsaJWKTest(3 tests: public key, public+private key, public+private cert)The keys are throwaway test fixtures with no production impact (the
mainsources contain no 1024/512-bit RSA), but bumping them removes the finding and keeps the test crypto aligned with current best practice.Backward compatibility / correctness
The affected tests assert round-trip properties (modulus/exponent equality, JWK encode/decode, encrypt/decrypt) that are independent of key size, so they pass unchanged.
Testing
json-crypto/core—JsonCryptoTest: 4/4 pass.json-web-token—RsaJWKTest: 13/13 pass.mvn -ooffline): BUILD SUCCESS.