Skip to main content

What the check does

Flags contains('…literal…', <context>) where the first argument is a literal string haystack and the second is an attacker-influenceable context — a branch ref, PR label, title, and so on.

Why it matters

contains(haystack, needle) performs a substring test when the haystack is a string. If the needle is attacker-controlled, a crafted value that happens to be a substring of the haystack satisfies the check:

Safe alternative

Test membership against an exact list, not a substring: