What the check does
Two hazards, both decided on the parsed document rather than by pattern-matching text.1. A foreign YAML tag — HIGH, blocks
!!python/object, !ruby/object, !!php/object and friends instruct a parser
that honours them to construct a language-specific object — which for several
parsers means executing code during load, turning a config file into a
deserialization sink.
Nothing in a CI/CD pipeline definition has a legitimate reason to carry one. If
you did not add it, treat the file as untrusted and find out who did: a foreign
tag in a pipeline definition is an attack shape, not a style choice.
2. Multiplying anchor expansion — MEDIUM, warns
Nesting is what the rule keys on, not size
This is the part that makes the second half usable. Flat anchor reuse — one template shared by many jobs — is the ordinary, correct way to share configuration, and it never multiplies however widely it is used:.base → .withdeps → jobs) with
small bodies stays far under the threshold.
The expansion figure in the finding is what the parser would actually build,
computed with memoization and saturating arithmetic — so measuring a bomb cannot
become one.
GitLab’s !reference is never flagged
!reference is a first-class part of the .gitlab-ci.yml language. It is
allowlisted alongside the YAML core schema (!!str, !!int, !!bool, !!seq,
!!map, …) and !!merge, the tag behind the <<: merge key.