Skip to content

Which is the best practice for customizing (or reusing source, sink) of codeql core libraries? #697

Answered by MathiasVP
vovikhangcdv asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @vovikhangcdv,

If you replace your two imports:

 import semmle.javascript.security.dataflow.CommandInjectionCustomizations::CommandInjection
 import semmle.javascript.security.dataflow.ShellCommandInjectionFromEnvironmentCustomizations::ShellCommandInjectionFromEnvironment

with

import semmle.javascript.security.dataflow.CommandInjectionCustomizations
import semmle.javascript.security.dataflow.ShellCommandInjectionFromEnvironmentCustomizations

(i.e., without the :: part)

then you can rewrite your configuration as:

class MyConfig extends TaintTracking::Configuration {
  MyConfig() { this = "MyConfig" }

  override predicate isSource(Node node) {
    node instanceof CommandInjection::Source 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@vovikhangcdv
Comment options

Answer selected by vovikhangcdv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants