Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space CBJS and version Publish

Tracks user-controlled values into 'eval' calls (special case of js/code-injection), and generates a visualizable path from the source to the sink.

Ql
import javascript::
import DataFlow
import DataFlow::PathGraph

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

  override predicate isSource(Node node) { node instanceof RemoteFlowSource }

  override predicate isSink(Node node) { node = globalVarRef("eval").getACall().getArgument(0) }
}

from EvalTaint cfg, PathNode source, PathNode sink
where cfg.hasFlowPath(source, sink)
select sink.getNode(), source, sink, "Eval with user-controlled input from $@.", source.getNode(),
  "here"
Htmlcomment
hiddentrue
hashconfluence_uploader_hash:f9a665051880b3c712207fcdbdef8f83d75d48eabef4d5a30166449d0e960df65b05a2e619920116