Fedora Account System
Red Hat Associate
Red Hat Customer
## CR spec values passed to Ansible without unsafe-marking by default (Jinja2 template injection) **CWEs:** CWE-1336, CWE-94 **CVSS:** 8.5 (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H) **Component:** kiali-ossm/ansible-operator-plugins ### Description makeParameters() copies every field of a watched custom resource's spec verbatim into the ansible-runner extravars, and only wraps string values with __ansible_unsafe when the watch sets markUnsafe: true. The default is false (watches.go:81) and the scaffolded watches.yaml does not enable it. Ansible renders extra vars through Jinja2 wherever a playbook or role templates them, so a Kubernetes user who can create or update the watched CR (a namespaced, typically low-privilege grant) can place Jinja2 expressions in spec fields that are evaluated inside the operator pod during reconciliation. ### Affected Locations - `:` - `:` ### Evidence **internal/ansible/runner/runner.go:356-360 — unsafe-marking is opt-in** ```go if r.markUnsafe { for key, val := range parameters { parameters[key] = markUnsafe(val) } } ``` **internal/ansible/watches/watches.go:81 — default leaves CR values templatable** ```go markUnsafeDefault = false ``` ### Attack Pattern A user with create/update on the watched CR gains code execution in the operator pod and thereby the operator service account's cluster RBAC. --- *Source: Ex-Wing security assessment, finding FIND-001*