{"id":"CVE-2024-52799","aliases":["GHSA-fgrf-2886-4q7m"],"summary":"Argo Workflows Chart: Excessive Privileges in Workflow Role","published_at":"2024-11-21T09:00:56Z","modified_at":"2024-11-23T03:35:07Z","products":[{"slug":"argo-cd","name":"Argo CD","category":"gitops-cicd"}],"rating":{"severity":"high","score":8.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H","attack_path":"local","user_interaction":true,"malicious":false},"fix_available":false,"kev":{"listed":false,"ransomware":false},"public_exploit":false,"exploits":[],"epss":{"score":0.0021100000012665987,"percentile":0.1164499968290329,"date":"2026-11-20T00:00:00Z"},"priority":7.2,"record_count":2,"vendors":["GitHub"],"details":"Argo Workflows Chart is used to set up argo and its needed dependencies through one command. Prior to 0.44.0, the workflow-role has excessive privileges, the worst being create pods/exec, which will allow kubectl exec into any Pod in the same namespace, i.e. arbitrary code execution within those Pods. If a user can be made to run a malicious template, their whole namespace can be compromised. This affects versions of the argo-workflows Chart that use appVersion: 3.4 and above, which no longer need these permissions for the only available Executor, Emissary. It could also affect users below 3.4 depending on their choice of Executor in those versions. This only affects the Helm Chart and not the upstream manifests. This vulnerability is fixed in 0.44.0.","affected_stack":[{"ecosystem":"GitHub","package":"argoproj/argo-helm/https://argoproj.github.io/argo-helm/argo-workflows","provider":"github-repo-advisories","source":"GHSA-fgrf-2886-4q7m","relation":"self"}],"affected_other":[{"ecosystem":"CVE","package":"argoproj/argo-helm","versions":["< 0.44.0"],"provider":"cvelistv5","source":"CVE-2024-52799","relation":"self"}],"product_status":[],"records":[{"provider":"cvelistv5","source_id":"CVE-2024-52799","relation":"self","url":"https://www.cve.org/CVERecord?id=CVE-2024-52799","license":"CC-BY-4.0","published_at":"2024-11-21T17:02:01.525Z","modified_at":"2024-11-21T20:48:51.507Z","summary":"Argo Workflows Chart: Excessive Privileges in Workflow Role","details":"Argo Workflows Chart is used to set up argo and its needed dependencies through one command. Prior to 0.44.0, the workflow-role has excessive privileges, the worst being create pods/exec, which will allow kubectl exec into any Pod in the same namespace, i.e. arbitrary code execution within those Pods. If a user can be made to run a malicious template, their whole namespace can be compromised. This affects versions of the argo-workflows Chart that use appVersion: 3.4 and above, which no longer need these permissions for the only available Executor, Emissary. It could also affect users below 3.4 depending on their choice of Executor in those versions. This only affects the Helm Chart and not the upstream manifests. This vulnerability is fixed in 0.44.0.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H","source":"CVE-2024-52799"}],"affected":[{"ecosystem":"CVE","package":"argoproj/argo-helm","versions":["< 0.44.0"],"provider":"cvelistv5","source":"CVE-2024-52799","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://github.com/argoproj/argo-helm/security/advisories/GHSA-fgrf-2886-4q7m"},{"type":"WEB","url":"https://github.com/argoproj/argo-helm/commit/81dc44c4a5ccd42c799469a78eb96a68048a4987"}]},{"provider":"github-repo-advisories","source_id":"GHSA-fgrf-2886-4q7m","relation":"self","url":"https://github.com/argoproj/argo-helm/security/advisories/GHSA-fgrf-2886-4q7m","license":"GitHub Terms of Service","published_at":"2024-11-21T09:00:56Z","modified_at":"2024-11-23T03:35:07Z","summary":"Workflows: Excessive Privileges in Workflow Role","details":"> [!IMPORTANT]\r\n>  This only affects the Helm Chart and not the upstream manifests\r\n\r\n### Summary\r\nThe [`workflow-role`](https://github.com/argoproj/argo-helm/blob/2653aef414ab6a5d8617af75f04190a8f7da28dc/charts/argo-workflows/templates/controller/workflow-role.yaml) has excessive privileges, the worst being [`create` `pods/exec`](https://github.com/argoproj/argo-helm/blob/2653aef414ab6a5d8617af75f04190a8f7da28dc/charts/argo-workflows/templates/controller/workflow-role.yaml#L34), which will allow `kubectl exec` into any Pod in the same namespace, i.e. arbitrary code execution within those Pods. If a user can be made to run a malicious template, their whole namespace can be compromised.\r\n\r\nThis privilege [was used](https://github.com/argoproj/argo-workflows/pull/12975/files#diff-d595f7190d1d43c9d2a43adb3fc16caa91985361045ff117dcb755855e166b8b) by the `k8sapi` Executor in older Argo Workflows versions <=3.3 when selected. In versions >=3.4, only the Emissary Executor is available, and it [does not use](https://argo-workflows.readthedocs.io/en/release-3.5/workflow-rbac/) any forms of elevated privileges. See also a summary of the Executors in an older version of the docs: https://argo-workflows.readthedocs.io/en/release-3.4/workflow-executors/.\r\n\r\nThis was resolved by https://github.com/argoproj/argo-helm/pull/3044\r\n\r\n### Details\r\n\r\nThe `workflow-role` has excessive privileges:\r\n\r\n#### `pods/exec` and `pods/log`\r\n\r\n- [`pods/exec`](https://github.com/argoproj/argo-helm/blob/2653aef414ab6a5d8617af75f04190a8f7da28dc/charts/argo-workflows/templates/controller/workflow-role.yaml#L32) is not needed.\r\n  - Upstream, [only the Controller](https://github.com/argoproj/argo-workflows/blob/5aac5a8f61f4e8273d04509dffe7d80123ff67f5/manifests/cluster-install/workflow-controller-rbac/workflow-controller-clusterrole.yaml#L10) uses this when necessary to [enforce timely termination](https://github.com/argoproj/argo-workflows/blob/5aac5a8f61f4e8273d04509dffe7d80123ff67f5/workflow/signal/signal.go#L19)\r\n  - In Argo Workflows versions <=3.3, the `pods/exec` permission could be used by [the `k8sapi` Executor](https://github.com/argoproj/argo-workflows/pull/12975/files#diff-d595f7190d1d43c9d2a43adb3fc16caa91985361045ff117dcb755855e166b8b). In versions >= 3.4, Emissary is the only Executor and it [does not use this privilege](https://argo-workflows.readthedocs.io/en/release-3.5/workflow-rbac/).\r\n- [`pods/log`](https://github.com/argoproj/argo-helm/blob/2653aef414ab6a5d8617af75f04190a8f7da28dc/charts/argo-workflows/templates/controller/workflow-role.yaml#L25) is not needed.\r\n  - Upstream, [only the Server](https://github.com/argoproj/argo-workflows/blob/5aac5a8f61f4e8273d04509dffe7d80123ff67f5/manifests/cluster-install/argo-server-rbac/argo-server-clusterole.yaml#L26) uses this to retrieve logs for workflow Pods for displaying via the API, CLI, UI.\r\n  - In Argo Workflows versions <=3.3, the `pods/log` permission could be used by [the `k8sapi` Executor](https://github.com/argoproj/argo-workflows/pull/12975/files#diff-d595f7190d1d43c9d2a43adb3fc16caa91985361045ff117dcb755855e166b8b). In versions >= 3.4, Emissary is the only Executor and it [does not use this privilege](https://argo-workflows.readthedocs.io/en/release-3.5/workflow-rbac/).\r\n- [`pods`](https://github.com/argoproj/argo-helm/blob/2653aef414ab6a5d8617af75f04190a8f7da28dc/charts/argo-workflows/templates/controller/workflow-role.yaml#L17) is not needed.\r\n  - Upstream, [the Controller](https://github.com/argoproj/argo-workflows/blob/5aac5a8f61f4e8273d04509dffe7d80123ff67f5/manifests/cluster-install/workflow-controller-rbac/workflow-controller-clusterrole.yaml#L9) and [the Server](https://github.com/argoproj/argo-workflows/blob/5aac5a8f61f4e8273d04509dffe7d80123ff67f5/manifests/cluster-install/argo-server-rbac/argo-server-clusterole.yaml#L24) use this to manipulate child Pods\r\n  - In Argo Workflows versions <=3.3, the Executor [would use](https://argo-workflows.readthedocs.io/en/release-3.5/workflow-rbac/) `patch` and `get` `pods`. In versions >= 3.4 though, these permissions were replaced with `create` and `patch` `workflowtaskresults`. The upstream code could also fallback to `patch` `pod` with a deprecation warning, although the upstream manifests no longer included this. In >=3.6, the legacy fallback [will be removed](https://github.com/argoproj/argo-workflows/pull/13100).\r\n   - Only [the `k8sapi` Executor](https://github.com/argoproj/argo-workflows/pull/12975/files#diff-d595f7190d1d43c9d2a43adb3fc16caa91985361045ff117dcb755855e166b8b) would use `watch`\r\n\r\n### PoC\r\nInstall per [instructions](https://github.com/argoproj/argo-helm/tree/8130224/charts/argo-workflows#installing-the-chart) with a [Workflow SA](https://github.com/argoproj/argo-helm/tree/8130224/charts/argo-workflows#serviceaccount-for-workflow-spec):\r\n```\r\nhelm repo add argo https://argoproj.github.io/argo-helm\r\nhelm install my-release argo/argo-workflows -f values.yaml\r\n```\r\n\r\n```yaml\r\n# values.yaml\r\nworkflow:\r\n  serviceAccount:\r\n    create: true\r\n    name: \"argo-workflow\"\r\n  rbac:\r\n    create: true\r\ncontroller:\r\n  workflowNamespaces:\r\n    - default\r\n```    \r\n\r\nRun Workflow that execs into the Controller\r\n```yaml\r\napiVersion: argoproj.io/v1alpha1\r\nkind: Workflow\r\nmetadata:\r\n  generateName: hello-world-in-controller-\r\nspec:\r\n  entrypoint: controller-exec\r\n  serviceAccountName: argo-workflow # Set ServiceAccount\r\n  templates:\r\n    - name: controller-exec\r\n      container:\r\n        image: bitnami/kubectl\r\n        command: [ kubectl ]\r\n        args: \r\n          - exec\r\n          - workflow-controller\r\n          - echo\r\n          - \"hello world\"\r\n```\r\n\r\n### Impact\r\n\r\nAnyone who uses the provided `workflow-role` may be vulnerable to arbitrary code execution from a malicious template.\r\n\r\nThe role is currently installed [by default](https://github.com/argoproj/argo-helm/blob/2653aef414ab6a5d8617af75f04190a8f7da28dc/charts/argo-workflows/values.yaml#L71). Fortunately though, the attached SA is [_not_ installed by default](https://github.com/argoproj/argo-helm/blob/2653aef414ab6a5d8617af75f04190a8f7da28dc/charts/argo-workflows/values.yaml#L59) and would still have to be manually added as a `serviceAccountName` to a Workflow or template.\r\n\r\nThis affects versions of the `argo-workflows` Chart that use `appVersion: 3.4` and above, which no longer need these permissions for the only available Executor, Emissary. It could also affect users below 3.4 depending on their choice of Executor in those versions.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H","source":"GHSA-fgrf-2886-4q7m"}],"affected":[{"ecosystem":"GitHub","package":"argoproj/argo-helm/https://argoproj.github.io/argo-helm/argo-workflows","provider":"github-repo-advisories","source":"GHSA-fgrf-2886-4q7m","relation":"self"}],"product_status":[],"references":[{"type":"ADVISORY","url":"https://github.com/argoproj/argo-helm/security/advisories/GHSA-fgrf-2886-4q7m"}]}],"references":[{"type":"WEB","url":"https://github.com/argoproj/argo-helm/security/advisories/GHSA-fgrf-2886-4q7m"},{"type":"WEB","url":"https://github.com/argoproj/argo-helm/commit/81dc44c4a5ccd42c799469a78eb96a68048a4987"}],"sources":[{"provider":"cvelistv5","source_id":"CVE-2024-52799","url":"https://www.cve.org/CVERecord?id=CVE-2024-52799","license":"CC-BY-4.0","modified_at":"2024-11-21T20:48:51.507Z","relation":"self"},{"provider":"github-repo-advisories","source_id":"GHSA-fgrf-2886-4q7m","url":"https://github.com/argoproj/argo-helm/security/advisories/GHSA-fgrf-2886-4q7m","license":"GitHub Terms of Service","modified_at":"2024-11-23T03:35:07Z","relation":"self"}]}
