mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
Refactor MissingJWTSignatureCheck
This commit is contained in:
@@ -5,10 +5,12 @@ import semmle.code.java.dataflow.DataFlow
|
||||
import semmle.code.java.security.JWT
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use `MissingJwtSignatureCheckFlow` instead.
|
||||
*
|
||||
* Models flow from signing keys assignments to qualifiers of JWT insecure parsers.
|
||||
* This is used to determine whether a `JwtParser` performing unsafe parsing has a signing key set.
|
||||
*/
|
||||
class MissingJwtSignatureCheckConf extends DataFlow::Configuration {
|
||||
deprecated class MissingJwtSignatureCheckConf extends DataFlow::Configuration {
|
||||
MissingJwtSignatureCheckConf() { this = "SigningToExprDataFlow" }
|
||||
|
||||
override predicate isSource(DataFlow::Node source) {
|
||||
@@ -21,3 +23,19 @@ class MissingJwtSignatureCheckConf extends DataFlow::Configuration {
|
||||
any(JwtParserWithInsecureParseAdditionalFlowStep c).step(node1, node2)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Models flow from signing keys assignments to qualifiers of JWT insecure parsers.
|
||||
* This is used to determine whether a `JwtParser` performing unsafe parsing has a signing key set.
|
||||
*/
|
||||
private module MissingJwtSignatureCheckConfig implements DataFlow::ConfigSig {
|
||||
predicate isSource(DataFlow::Node source) { source instanceof JwtParserWithInsecureParseSource }
|
||||
|
||||
predicate isSink(DataFlow::Node sink) { sink instanceof JwtParserWithInsecureParseSink }
|
||||
|
||||
predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) {
|
||||
any(JwtParserWithInsecureParseAdditionalFlowStep c).step(node1, node2)
|
||||
}
|
||||
}
|
||||
|
||||
module MissingJwtSignatureCheckFlow = DataFlow::Global<MissingJwtSignatureCheckConfig>;
|
||||
|
||||
Reference in New Issue
Block a user