-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Java: Add MaDs for java.crypto.KDF
#20345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Click to show differences in coveragejavaGenerated file changes for java
- Java extensions,"``javax.*``, ``jakarta.*``",87,4159,90,10,4,2,1,1,4
+ Java extensions,"``javax.*``, ``jakarta.*``",87,4185,90,10,4,2,1,1,4
- Totals,,330,26328,2656,404,16,128,33,1,409
+ Totals,,330,26354,2656,404,16,128,33,1,409
- javax.crypto,19,,114,,,12,3,,2,2,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,61,53
+ javax.crypto,19,,140,,,12,3,,2,2,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,76,64 |
e284e6e
to
fa73d5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Model as Data (MaD) support for the java.crypto.KDF
API, enabling taint tracking through Key Derivation Function operations. The changes include comprehensive taint flow models for KDF operations and HKDF parameter specifications.
- Adds taint flow models for
javax.crypto.KDF
class methods - Adds taint flow models for
javax.crypto.spec.HKDFParameterSpec
and its builder pattern - Includes comprehensive test coverage for various KDF usage patterns
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
java/ql/lib/ext/javax.crypto.model.yml |
Adds summary models for KDF class methods including deriveKey and deriveData |
java/ql/lib/ext/javax.crypto.spec.model.yml |
Adds taint flow models for HKDF parameter specification builder methods and constructors |
java/ql/test/library-tests/dataflow/kdf/test.ql |
Test query for verifying taint flow through KDF operations |
java/ql/test/library-tests/dataflow/kdf/KDFDataflowTest.java |
Comprehensive test cases covering various KDF usage patterns |
java/ql/test/library-tests/dataflow/kdf/options |
Compilation options enabling Java 25 preview features |
java/ql/lib/change-notes/2025-09-02-kdf-api.md |
Release notes documenting the new KDF taint flow support |
fa73d5e
to
ccfbf55
Compare
a34b362
to
5d2268f
Compare
- ["javax.crypto", "KDF", False, "getInstance", "(String,KDFParameters,Provider)", "", "Argument[0]", "ReturnValue.SyntheticField[javax.crypto.KDF.algorithm]", "value", "manual"] | ||
- ["javax.crypto", "KDF", False, "getInstance", "(String,KDFParameters,String)", "", "Argument[0]", "ReturnValue.SyntheticField[javax.crypto.KDF.algorithm]", "value", "manual"] | ||
- ["javax.crypto", "KDF", True, "getAlgorithm", "()", "", "Argument[this].SyntheticField[javax.crypto.KDF.algorithm]", "ReturnValue", "value", "manual"] | ||
- ["javax.crypto", "KDF", True, "getProvider", "()", "", "Argument[this]", "ReturnValue", "value", "manual"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line looks suspicious. It suggests that getProvider()
is implemented as return this
. Should this have been a taint model rather than a value-preserving step?
java/ql/test-kotlin1/library-tests/java-kotlin-collection-type-generic-methods/test.expected
Outdated
Show resolved
Hide resolved
424362a
to
c360fc8
Compare
c360fc8
to
728a4af
Compare
Updates Java MaDs for
java.crypto.KDF
.Java Docs - KDF: https://docs.oracle.com/en/java/javase/24/docs/api/java.base/javax/crypto/KDF.html
Java Docs - HKDFParameterSpec: https://docs.oracle.com/en/java/javase/24/docs/api/java.base/javax/crypto/spec/HKDFParameterSpec.html
Java release note: https://jdk.java.net/25/release-notes#510