CodeQL library for Go
codeql/go-all 0.7.15-dev (changelog, source)
Search

Predicate regexpFunctionChecksExpr

Holds if resultNode comes from a call to a regexp match function, considered as a barrier guard for sanitizing untrusted URLs.

This is overapproximate: we do not attempt to reason about the correctness of the regexp.

Use this if you want to define a derived DataFlow::BarrierGuard without make the type recursive. Otherwise use RegexpCheckBarrier.

Import path

import semmle.go.dataflow.barrierguardutil.RegexpCheck
predicate regexpFunctionChecksExpr(Node resultNode, Expr checked, boolean branch)