Standard Library

GoRegexp

regexp package. FindString() and FindAllString() return tainted matches. MustCompile() with user-controlled pattern is a ReDoS risk.

2 sinks
Taint flow0 sources 2 sinks
Sinks — dangerous call
.Compile()
.MustCompile()

Sinks

.Compile()Sink
#
Signature
Compile(expr string) (*Regexp, error)

Compiles regex. ReDoS risk when expr is user-controlled.

tracks:0
.MustCompile()Sink
#
Signature
MustCompile(str string) *Regexp

Compiles regex, panics on error. ReDoS risk when str is user-controlled.

tracks:0

Other Methods

.FindString()Neutral
#
Signature
FindString(s string) string

Returns leftmost match. Source of tainted string from user input.

Fully-Qualified Names

FQNField
regexpfqns[0]

Wrong FQN → 0 findings. Verify with: change fqns to garbage → must produce 0 results.

Import

go.mod
// standard library — no go.mod entry required
rule.py
from codepathfinder.go_rule import GoRegexp