Variable Injection

Detects variable injection risks and unsafe variable usage

5 rules in variable_injection.yml

HIGH: 4 | MEDIUM: 1

Rule IDSeverityTitleDescriptionRefs
dynamic_include_injectionHIGHDynamic Include Injectioninclude_vars / include_tasks targets a {{ … }} expression. A user-controlled include path executes whatever YAML the attacker can stage, with the playbook’s privileges.
groupvars_injectionHIGHGroup Variables Injection Riskgroup_vars[{{ … }}] indexes the group_vars dict by a user-controlled expression. The pattern lets attackers pivot into any group’s variable namespace at runtime.
hostvars_injectionHIGHHostvars Injection RiskUsing hostvars with user-controlled input can lead to variable injection
vars_lookup_injectionHIGHVariables Lookup Injectionlookup(‘vars’, {{ … }}) reads a variable named by a user-controlled expression. Attackers can pull vault-resident values whose names they would not otherwise know.
register_variable_injectionMEDIUMRegister Variable Injectionregister: ‘{{ … }}’ uses a Jinja expression as the variable name. Attacker-controlled register names overwrite vault-loaded values mid-play.