CodeQL library for JavaScript/TypeScript
codeql/javascript-all 2.0.2-dev (changelog, source)
Search

Member predicate API::Node::asSink

Get a data-flow node where this value leaves the current codebase and flows into an external library (or in general, any external codebase).

Concretely, this is either an argument passed to a call to external code, or the right-hand side of a property write on an object flowing into such a call.

For example:

// 'x' is matched by API::moduleImport("foo").getParameter(0).asSink()
require('foo')(x);

// 'x' is matched by API::moduleImport("foo").getParameter(0).getMember("prop").asSink()
require('foo')({
  prop: x
});
Node asSink()