-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Quantum: Add OpenSSL PKEY algorithm value consumers. #19547
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
Quantum: Add OpenSSL PKEY algorithm value consumers. #19547
Conversation
…of the additional modeling, updated the generic dataflow source to match JCA with how "EC" is handled as a consumed algorithm for PKEY.
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
Adds modeling of PKEY algorithm value consumers for OpenSSL in CodeQL, enabling data-flow analysis for EVP_PKEY_* operations.
- Introduces a new
PKeyAlgorithmValueConsumer
subclass (EVPPKeyAlgorithmConsumer
) to capture algorithm arguments for various EVP_PKEY functions. - Registers the new consumer in
OpenSSLAlgorithmValueConsumers.qll
. - Updates
Language.qll
to use the new taint-tracking API (TaintTracking
) and adds aConstantDataSource
for literals.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmValueConsumers/PKeyAlgorithmValueConsumer.qll | New consumer class capturing algorithm arguments for EVP_PKEY calls |
cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmValueConsumers/OpenSSLAlgorithmValueConsumers.qll | Imports the new PKey algorithm value consumer |
cpp/ql/lib/experimental/quantum/Language.qll | Switches to TaintTracking API and adds ConstantDataSource |
Comments suppressed due to low confidence (2)
cpp/ql/lib/experimental/quantum/Language.qll:110
- The
DataFlow::ConfigSig
interface is referenced butDataFlow
is no longer imported; add backimport semmle.code.cpp.dataflow.new.DataFlow
or update this to useTaintTracking
.
module ArtifactUniversalFlowConfig implements DataFlow::ConfigSig {
cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmValueConsumers/PKeyAlgorithmValueConsumer.qll:10
- No unit tests have been added for this new consumer; consider adding tests that cover each EVP_PKEY_* function case to validate correct data-flow modeling.
class EVPPKeyAlgorithmConsumer extends PKeyValueConsumer {
cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmValueConsumers/PKeyAlgorithmValueConsumer.qll
Outdated
Show resolved
Hide resolved
@@ -86,6 +86,27 @@ module GenericDataSourceFlowConfig implements DataFlow::ConfigSig { | |||
} | |||
} | |||
|
|||
module GenericDataSourceFlow = TaintTracking::Global<GenericDataSourceFlowConfig>; | |||
|
|||
private class ConstantDataSource extends Crypto::GenericConstantSourceInstance instanceof Literal { |
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.
Can you test this with MRVA or DCA before merging? I worry the performance impact will be severe from this.
Co-authored-by: Copilot <[email protected]>
Value consumer modeling for PKEY alg consumers in openssl.