Skip to content

Instantly share code, notes, and snippets.

@artem-smotrakov
Last active February 17, 2021 13:27
Show Gist options
  • Save artem-smotrakov/2206ef252a8c9a74a71e452c513394a9 to your computer and use it in GitHub Desktop.
Save artem-smotrakov/2206ef252a8c9a74a71e452c513394a9 to your computer and use it in GitHub Desktop.
CodeQL config for detecting JEXL injections, see https://github.com/github/codeql/pull/4965/files for details
class JexlInjectionConfig extends TaintTracking::Configuration {
JexlInjectionConfig() { this = "JexlInjectionConfig" }
override predicate isSource(DataFlow::Node source) {
source instanceof RemoteFlowSource
}
override predicate isSink(DataFlow::Node sink) { sink instanceof JexlEvaluationSink }
override predicate isAdditionalTaintStep(DataFlow::Node fromNode, DataFlow::Node toNode) {
any(TaintPropagatingJexlMethodCall c).taintFlow(fromNode, toNode) or
returnsDataFromBean(fromNode, toNode)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment