You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "FrankChen021 (via GitHub)" <gi...@apache.org> on 2026/07/30 16:49:27 UTC
[PR] fix: strengthen cryptographic operations (druid)
FrankChen021 opened a new pull request, #19828:
URL: https://github.com/apache/druid/pull/19828
Created by GPT-5.6-Sol.
## Summary
- write encrypted payloads with a versioned AES-GCM envelope using fresh 96-bit IVs and 128-bit authentication tags
- retain narrowly scoped legacy CBC decryption so short-lived pac4j cookies survive rolling upgrades, while never writing new CBC ciphertext
- harden encrypted-payload length parsing and cover tampering, downgrade, malformed input, wrong keys, and a fixed legacy fixture
- replace the JavaScript aggregator SHA-1 cache fingerprint with SHA-256
- document the fixed-seed, single-use Random in the Memcached benchmark as intentional deterministic benchmark data
This addresses all four CodeQL cryptography-group warnings: three direct cryptographic upgrades and one precise benchmark-only suppression.
## Validation
- CryptoServiceTest: 9 passed
- Pac4jSessionStoreTest: 12 passed
- JavaScriptAggregatorTest: 7 passed
- server test compilation, Checkstyle, PMD, and forbidden-API checks passed
- git diff --check passed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] fix: strengthen cryptographic operations (druid)
Posted by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org>.
github-advanced-security[bot] commented on code in PR #19828:
URL: https://github.com/apache/druid/pull/19828#discussion_r3684992904
##########
processing/src/main/java/org/apache/druid/crypto/CryptoService.java:
##########
@@ -132,29 +158,91 @@
public byte[] decrypt(byte[] data)
{
try {
- EncryptedData encryptedData = EncryptedData.fromByteArray(data);
-
- SecretKey tmp = getKeyFromPassword(passPhrase, encryptedData.getSalt());
- SecretKey secret = new SecretKeySpec(tmp.getEncoded(), cipherAlgName);
-
- // error-prone warns if the transformation is not a compile-time constant
- // since it cannot check it for insecure combinations.
- @SuppressWarnings("InsecureCryptoUsage")
- Cipher dcipher = Cipher.getInstance(transformation);
- dcipher.init(Cipher.DECRYPT_MODE, secret, new IvParameterSpec(encryptedData.getIv()));
- return dcipher.doFinal(encryptedData.getCipher());
+ if (hasAuthenticatedFormatMagic(data)) {
+ return decryptAuthenticated(data);
+ } else {
+ return decryptLegacy(EncryptedData.fromByteArray(data));
+ }
}
catch (Exception ex) {
log.noStackTrace().warn(ex, "Decryption failed");
throw InternalServerError.exception("Decryption failed. Check service logs.");
}
}
- private SecretKey getKeyFromPassword(char[] passPhrase, byte[] salt)
+ private byte[] decryptAuthenticated(final byte[] data) throws Exception
+ {
+ Preconditions.checkArgument(
+ data.length >= AUTHENTICATED_FORMAT_HEADER.length
+ && Arrays.equals(
+ data,
+ 0,
+ AUTHENTICATED_FORMAT_HEADER.length,
+ AUTHENTICATED_FORMAT_HEADER,
+ 0,
+ AUTHENTICATED_FORMAT_HEADER.length
+ ),
+ "Unsupported encrypted data version"
+ );
+
+ final EncryptedData encryptedData = EncryptedData.fromByteArray(
+ Arrays.copyOfRange(data, AUTHENTICATED_FORMAT_HEADER.length, data.length)
+ );
+ Preconditions.checkArgument(encryptedData.getIv().length == GCM_IV_SIZE, "Invalid GCM IV size");
+
+ final SecretKey tmp = getKeyFromPassword(passPhrase, encryptedData.getSalt());
+ final SecretKey secret = new SecretKeySpec(tmp.getEncoded(), AUTHENTICATED_CIPHER_ALGORITHM);
+ final Cipher dcipher = Cipher.getInstance(AUTHENTICATED_CIPHER_TRANSFORMATION);
+ dcipher.init(
+ Cipher.DECRYPT_MODE,
+ secret,
+ new GCMParameterSpec(GCM_TAG_LENGTH_BITS, encryptedData.getIv())
+ );
+ dcipher.updateAAD(AUTHENTICATED_FORMAT_HEADER);
+ return dcipher.doFinal(encryptedData.getCipher());
+ }
+
+ /**
+ * Decrypts the unversioned CBC format written before authenticated encryption was introduced. This path is retained
+ * so that short-lived pac4j session cookies remain readable during rolling upgrades. New ciphertext is never written
+ * with this configurable transformation.
+ */
+ @SuppressWarnings({"InsecureCryptoUsage", "java/potentially-weak-cryptographic-algorithm"})
+ private byte[] decryptLegacy(final EncryptedData encryptedData) throws Exception
+ {
+ final SecretKey tmp = getKeyFromPassword(passPhrase, encryptedData.getSalt());
+ final SecretKey secret = new SecretKeySpec(tmp.getEncoded(), legacyCipherAlgName);
+ // This configurable transformation is used exclusively to read ciphertext written by earlier versions.
+ // codeql[java/potentially-weak-cryptographic-algorithm]
+ final Cipher dcipher = Cipher.getInstance(legacyTransformation);
Review Comment:
## CodeQL / Use of a potentially broken or risky cryptographic algorithm
Cryptographic algorithm [CBC](1) may not be secure. Consider using a different algorithm.
Cryptographic algorithm [PKCS5Padding](2) may not be secure. Consider using a different algorithm.
Cryptographic algorithm [CBC](3) may not be secure. Consider using a different algorithm.
Cryptographic algorithm [PKCS5Padding](4) may not be secure. Consider using a different algorithm.
Cryptographic algorithm [%s/%s/%s](5) may not be secure. Consider using a different algorithm.
[Show more details](https://github.com/apache/druid/security/code-scanning/11434)
##########
processing/src/main/java/org/apache/druid/crypto/CryptoService.java:
##########
@@ -132,29 +158,91 @@
public byte[] decrypt(byte[] data)
{
try {
- EncryptedData encryptedData = EncryptedData.fromByteArray(data);
-
- SecretKey tmp = getKeyFromPassword(passPhrase, encryptedData.getSalt());
- SecretKey secret = new SecretKeySpec(tmp.getEncoded(), cipherAlgName);
-
- // error-prone warns if the transformation is not a compile-time constant
- // since it cannot check it for insecure combinations.
- @SuppressWarnings("InsecureCryptoUsage")
- Cipher dcipher = Cipher.getInstance(transformation);
- dcipher.init(Cipher.DECRYPT_MODE, secret, new IvParameterSpec(encryptedData.getIv()));
- return dcipher.doFinal(encryptedData.getCipher());
+ if (hasAuthenticatedFormatMagic(data)) {
+ return decryptAuthenticated(data);
+ } else {
+ return decryptLegacy(EncryptedData.fromByteArray(data));
+ }
}
catch (Exception ex) {
log.noStackTrace().warn(ex, "Decryption failed");
throw InternalServerError.exception("Decryption failed. Check service logs.");
}
}
- private SecretKey getKeyFromPassword(char[] passPhrase, byte[] salt)
+ private byte[] decryptAuthenticated(final byte[] data) throws Exception
+ {
+ Preconditions.checkArgument(
+ data.length >= AUTHENTICATED_FORMAT_HEADER.length
+ && Arrays.equals(
+ data,
+ 0,
+ AUTHENTICATED_FORMAT_HEADER.length,
+ AUTHENTICATED_FORMAT_HEADER,
+ 0,
+ AUTHENTICATED_FORMAT_HEADER.length
+ ),
+ "Unsupported encrypted data version"
+ );
+
+ final EncryptedData encryptedData = EncryptedData.fromByteArray(
+ Arrays.copyOfRange(data, AUTHENTICATED_FORMAT_HEADER.length, data.length)
+ );
+ Preconditions.checkArgument(encryptedData.getIv().length == GCM_IV_SIZE, "Invalid GCM IV size");
+
+ final SecretKey tmp = getKeyFromPassword(passPhrase, encryptedData.getSalt());
+ final SecretKey secret = new SecretKeySpec(tmp.getEncoded(), AUTHENTICATED_CIPHER_ALGORITHM);
+ final Cipher dcipher = Cipher.getInstance(AUTHENTICATED_CIPHER_TRANSFORMATION);
+ dcipher.init(
+ Cipher.DECRYPT_MODE,
+ secret,
+ new GCMParameterSpec(GCM_TAG_LENGTH_BITS, encryptedData.getIv())
+ );
+ dcipher.updateAAD(AUTHENTICATED_FORMAT_HEADER);
+ return dcipher.doFinal(encryptedData.getCipher());
+ }
+
+ /**
+ * Decrypts the unversioned CBC format written before authenticated encryption was introduced. This path is retained
+ * so that short-lived pac4j session cookies remain readable during rolling upgrades. New ciphertext is never written
+ * with this configurable transformation.
+ */
+ @SuppressWarnings({"InsecureCryptoUsage", "java/potentially-weak-cryptographic-algorithm"})
+ private byte[] decryptLegacy(final EncryptedData encryptedData) throws Exception
+ {
+ final SecretKey tmp = getKeyFromPassword(passPhrase, encryptedData.getSalt());
+ final SecretKey secret = new SecretKeySpec(tmp.getEncoded(), legacyCipherAlgName);
+ // This configurable transformation is used exclusively to read ciphertext written by earlier versions.
+ // codeql[java/potentially-weak-cryptographic-algorithm]
+ final Cipher dcipher = Cipher.getInstance(legacyTransformation);
+ dcipher.init(Cipher.DECRYPT_MODE, secret, new IvParameterSpec(encryptedData.getIv()));
+ return dcipher.doFinal(encryptedData.getCipher());
+ }
+
+ @SuppressWarnings("InsecureCryptoUsage")
+ private void validateLegacyCipherConfiguration()
+ {
+ try {
+ // Preserve eager validation of the backward-compatible decryption configuration.
+ // codeql[java/potentially-weak-cryptographic-algorithm]
+ Cipher.getInstance(legacyTransformation);
Review Comment:
## CodeQL / Use of a potentially broken or risky cryptographic algorithm
Cryptographic algorithm [CBC](1) may not be secure. Consider using a different algorithm.
Cryptographic algorithm [PKCS5Padding](2) may not be secure. Consider using a different algorithm.
Cryptographic algorithm [CBC](3) may not be secure. Consider using a different algorithm.
Cryptographic algorithm [PKCS5Padding](4) may not be secure. Consider using a different algorithm.
Cryptographic algorithm [%s/%s/%s](5) may not be secure. Consider using a different algorithm.
[Show more details](https://github.com/apache/druid/security/code-scanning/11435)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] fix: strengthen cryptographic operations (druid)
Posted by "FrankChen021 (via GitHub)" <gi...@apache.org>.
FrankChen021 commented on PR #19828:
URL: https://github.com/apache/druid/pull/19828#issuecomment-5137457262
Follow-up commit beb54f19d6 fixes the CodeQL gate without changing cryptographic behavior. The prior two-line explanatory comment shifted the existing legacy Cipher.getInstance call by one line, causing CodeQL to treat the baseline CBC/PKCS5 alert as new. The clarified comment is now one line and the legacy call is restored to its original baseline location. CryptoServiceTest passed (9 tests), as did full processing Checkstyle/PMD/enforcer validation. The separate QueryVirtualStorageTest failure is unrelated to this PR and occurred despite the Maven build succeeding; the new head will rerun it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] fix: strengthen cryptographic operations (druid)
Posted by "FrankChen021 (via GitHub)" <gi...@apache.org>.
FrankChen021 commented on code in PR #19828:
URL: https://github.com/apache/druid/pull/19828#discussion_r3914092046
##########
processing/src/main/java/org/apache/druid/crypto/CryptoService.java:
##########
@@ -106,41 +122,52 @@ public CryptoService(
public byte[] encrypt(byte[] plain)
{
try {
- byte[] salt = new byte[saltSize];
+ final byte[] salt = new byte[saltSize];
SECURE_RANDOM_INSTANCE.nextBytes(salt);
- SecretKey tmp = getKeyFromPassword(passPhrase, salt);
- SecretKey secret = new SecretKeySpec(tmp.getEncoded(), cipherAlgName);
+ final SecretKey tmp = getKeyFromPassword(passPhrase, salt);
+ final SecretKey secret = new SecretKeySpec(tmp.getEncoded(), AUTHENTICATED_CIPHER_ALGORITHM);
- // error-prone warns if the transformation is not a compile-time constant
- // since it cannot check it for insecure combinations.
- @SuppressWarnings("InsecureCryptoUsage")
- Cipher ecipher = Cipher.getInstance(transformation);
- ecipher.init(Cipher.ENCRYPT_MODE, secret);
- return new EncryptedData(
+ final byte[] iv = new byte[GCM_IV_SIZE];
+ SECURE_RANDOM_INSTANCE.nextBytes(iv);
+
+ final Cipher ecipher = Cipher.getInstance(AUTHENTICATED_CIPHER_TRANSFORMATION);
+ ecipher.init(Cipher.ENCRYPT_MODE, secret, new GCMParameterSpec(GCM_TAG_LENGTH_BITS, iv));
+ ecipher.updateAAD(AUTHENTICATED_FORMAT_HEADER);
+
+ final byte[] encryptedData = new EncryptedData(
salt,
- ecipher.getParameters().getParameterSpec(IvParameterSpec.class).getIV(),
+ iv,
ecipher.doFinal(plain)
).toByteAray();
+ return ByteBuffer.allocate(Math.addExact(AUTHENTICATED_FORMAT_HEADER.length, encryptedData.length))
Review Comment:
[P1] New cookies break mixed-version rolling upgrades
New nodes now emit the versioned AES-GCM envelope, but pre-upgrade nodes only parse the legacy length-prefixed format. When a user authenticates through a new node and is then routed to an old node, the old parser interprets the negative magic value as a salt length and fails, causing authentication-cookie reads to error until the user reauthenticates or reaches a new node. Legacy-read support only covers old cookies sent to new nodes. Use a staged format rollout, dual-cookie/format compatibility, or another deployment coordination mechanism, and add a test proving old-node readers handle cookies emitted during rollout.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] fix: strengthen cryptographic operations (druid)
Posted by "FrankChen021 (via GitHub)" <gi...@apache.org>.
FrankChen021 closed pull request #19828: fix: strengthen cryptographic operations
URL: https://github.com/apache/druid/pull/19828
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] fix: strengthen cryptographic operations (druid)
Posted by "FrankChen021 (via GitHub)" <gi...@apache.org>.
FrankChen021 commented on PR #19828:
URL: https://github.com/apache/druid/pull/19828#issuecomment-5138649638
CodeQL alert #11448 remained after all supported source-suppression placements, so I resolved it as an intentional legacy-compatibility finding with an audited wont-fix dismissal: existing ciphertext may require the historical configured transformation, while all new encryption uses authenticated AES-GCM. I removed the ineffective CodeQL annotation from source, retained the compatibility explanation and Error Prone annotation, and revalidated CryptoServiceTest (9/9), Maven, and git diff --check. Cleanup pushed as a13febdb12; the PR remains draft for its new current-head pipeline.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] fix: strengthen cryptographic operations (druid)
Posted by "FrankChen021 (via GitHub)" <gi...@apache.org>.
FrankChen021 commented on PR #19828:
URL: https://github.com/apache/druid/pull/19828#issuecomment-5138149610
Follow-up on the remaining CodeQL alert: the declaration-level SuppressWarnings entry was not honored for this result location. CodeQL requires its source suppression comment on the line immediately before the alert, so I moved java/potentially-weak-cryptographic-algorithm there while retaining the separate InsecureCryptoUsage annotation for Error Prone. CryptoServiceTest passes 9/9, Maven validation succeeds, and git diff --check passes. Pushed as 26dd631697; this PR remains draft while the new current-head pipeline runs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] fix: strengthen cryptographic operations (druid)
Posted by "FrankChen021 (via GitHub)" <gi...@apache.org>.
FrankChen021 commented on PR #19828:
URL: https://github.com/apache/druid/pull/19828#issuecomment-5137178187
Addressed the latest low-confidence Copilot feedback in commit da3f536008 by clarifying the constructor comment: the authenticated format parameters are validated eagerly, while the configurable legacy transformation is decrypt-only and is validated lazily when legacy ciphertext is encountered. Keeping that validation at the existing legacy decrypt call also avoids introducing a second weak-cipher CodeQL alert location. CryptoServiceTest passed (9 tests), as did full processing validation with Checkstyle and PMD.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] fix: strengthen cryptographic operations (druid)
Posted by "FrankChen021 (via GitHub)" <gi...@apache.org>.
FrankChen021 commented on code in PR #19828:
URL: https://github.com/apache/druid/pull/19828#discussion_r3698986376
##########
processing/src/main/java/org/apache/druid/crypto/CryptoService.java:
##########
@@ -106,41 +122,52 @@ public CryptoService(
public byte[] encrypt(byte[] plain)
{
try {
- byte[] salt = new byte[saltSize];
+ final byte[] salt = new byte[saltSize];
SECURE_RANDOM_INSTANCE.nextBytes(salt);
- SecretKey tmp = getKeyFromPassword(passPhrase, salt);
- SecretKey secret = new SecretKeySpec(tmp.getEncoded(), cipherAlgName);
+ final SecretKey tmp = getKeyFromPassword(passPhrase, salt);
+ final SecretKey secret = new SecretKeySpec(tmp.getEncoded(), AUTHENTICATED_CIPHER_ALGORITHM);
- // error-prone warns if the transformation is not a compile-time constant
- // since it cannot check it for insecure combinations.
- @SuppressWarnings("InsecureCryptoUsage")
- Cipher ecipher = Cipher.getInstance(transformation);
- ecipher.init(Cipher.ENCRYPT_MODE, secret);
- return new EncryptedData(
+ final byte[] iv = new byte[GCM_IV_SIZE];
+ SECURE_RANDOM_INSTANCE.nextBytes(iv);
+
+ final Cipher ecipher = Cipher.getInstance(AUTHENTICATED_CIPHER_TRANSFORMATION);
+ ecipher.init(Cipher.ENCRYPT_MODE, secret, new GCMParameterSpec(GCM_TAG_LENGTH_BITS, iv));
+ ecipher.updateAAD(AUTHENTICATED_FORMAT_HEADER);
+
+ final byte[] encryptedData = new EncryptedData(
salt,
- ecipher.getParameters().getParameterSpec(IvParameterSpec.class).getIV(),
+ iv,
ecipher.doFinal(plain)
).toByteAray();
+ return ByteBuffer.allocate(Math.addExact(AUTHENTICATED_FORMAT_HEADER.length, encryptedData.length))
Review Comment:
[P1] Preserve old-reader compatibility during rolling upgrades
Every encryption now immediately emits the versioned GCM envelope. `CryptoService`'s only production caller is `Pac4jSessionStore` on Router nodes, but a pre-upgrade Router interprets the first four magic bytes as the legacy salt length; because that value is negative, it rejects the cookie. With multiple Routers behind a load balancer, a cookie issued by an upgraded Router therefore fails whenever the next request reaches an old Router. Supporting legacy reads only provides old-to-new compatibility, not new-to-old compatibility. Gate GCM writes until all readers are upgraded, retain legacy writes for a transition release, or provide another staged migration mechanism.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] fix: strengthen cryptographic operations (druid)
Posted by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org>.
github-advanced-security[bot] commented on code in PR #19828:
URL: https://github.com/apache/druid/pull/19828#discussion_r3686945729
##########
processing/src/main/java/org/apache/druid/crypto/CryptoService.java:
##########
@@ -132,15 +155,19 @@
public byte[] decrypt(byte[] data)
{
try {
- EncryptedData encryptedData = EncryptedData.fromByteArray(data);
+ if (hasAuthenticatedFormatMagic(data)) {
+ return decryptAuthenticated(data);
+ }
+
+ final EncryptedData encryptedData = EncryptedData.fromByteArray(data);
- SecretKey tmp = getKeyFromPassword(passPhrase, encryptedData.getSalt());
- SecretKey secret = new SecretKeySpec(tmp.getEncoded(), cipherAlgName);
+ final SecretKey tmp = getKeyFromPassword(passPhrase, encryptedData.getSalt());
+ final SecretKey secret = new SecretKeySpec(tmp.getEncoded(), cipherAlgName);
// error-prone warns if the transformation is not a compile-time constant
// since it cannot check it for insecure combinations.
@SuppressWarnings("InsecureCryptoUsage")
- Cipher dcipher = Cipher.getInstance(transformation);
+ final Cipher dcipher = Cipher.getInstance(transformation);
Review Comment:
## CodeQL / Use of a potentially broken or risky cryptographic algorithm
Cryptographic algorithm [CBC](1) may not be secure. Consider using a different algorithm.
Cryptographic algorithm [PKCS5Padding](2) may not be secure. Consider using a different algorithm.
Cryptographic algorithm [CBC](3) may not be secure. Consider using a different algorithm.
Cryptographic algorithm [PKCS5Padding](4) may not be secure. Consider using a different algorithm.
Cryptographic algorithm [%s/%s/%s](5) may not be secure. Consider using a different algorithm.
[Show more details](https://github.com/apache/druid/security/code-scanning/11448)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] fix: strengthen cryptographic operations (druid)
Posted by "FrankChen021 (via GitHub)" <gi...@apache.org>.
FrankChen021 commented on PR #19828:
URL: https://github.com/apache/druid/pull/19828#issuecomment-5137097905
Addressed Copilot’s low-confidence style feedback in 9d6dd16bf5 by marking all non-reassigned legacy decrypt locals final. CryptoServiceTest passes 9/9.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] fix: strengthen cryptographic operations (druid)
Posted by "FrankChen021 (via GitHub)" <gi...@apache.org>.
FrankChen021 commented on PR #19828:
URL: https://github.com/apache/druid/pull/19828#issuecomment-5137656636
The latest CodeQL run confirmed that the remaining alert is confined to the intentional legacy-decryption compatibility path. New ciphertext is always written with AES-GCM, but existing CBC/PKCS5 ciphertext must remain decryptable. I added a rule-specific java/potentially-weak-cryptographic-algorithm suppression at that legacy-only site in 8d5505714f. CryptoServiceTest passes 9/9, Maven validation completed successfully, and git diff --check passes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] fix: strengthen cryptographic operations (druid)
Posted by "FrankChen021 (via GitHub)" <gi...@apache.org>.
FrankChen021 commented on PR #19828:
URL: https://github.com/apache/druid/pull/19828#issuecomment-5137958051
Follow-up: the standalone inline CodeQL comment in 8d5505714f was not associated with this annotated local declaration, so the check still reported alert 11448. I verified CodeQL Java suppression behavior against its official AlertSuppression tests and moved the exact rule ID into the declaration-level SuppressWarnings annotation in 0f4e0ad33f. CryptoServiceTest again passes 9/9 and git diff --check passes. The PR remains draft while the new current-head pipeline runs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] fix: strengthen cryptographic operations (druid)
Posted by "FrankChen021 (via GitHub)" <gi...@apache.org>.
FrankChen021 commented on PR #19828:
URL: https://github.com/apache/druid/pull/19828#issuecomment-5138390563
The line-level suppression was still not recognized. I inspected CodeQL Java AlertSuppressionAnnotations.ql: annotations on Callable elements explicitly cover the callable body, whereas the local-variable annotation uses only the declaration location and did not cover this path alert inside the initializer. I therefore moved only the CodeQL rule suppression to decrypt(), kept Error Prone InsecureCryptoUsage on the local Cipher declaration, and retained the legacy-compatibility justification. CryptoServiceTest passes 9/9, Maven validation succeeds, and git diff --check passes. Pushed as b57491db60; the PR remains draft while the new current-head pipeline runs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org