GHSA-HHFC-P593-43HF
Server: Information Disclosure with Fake Token in `client` mode
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-HHFC-P593-43HF divulgada · CVSS 5.3 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Remediación | Parche v4.0.12 | github.com/argoproj/argo-workflows/v4 · 0 d desde divulgación | |
| Remediación | Parche v4.1.4 | github.com/argoproj/argo-workflows/v4 · 0 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
When using `--auth-mode=client`, some information about the Server can be retrieved with a fake or spoofed token. In particular, the version of the Server https://github.com/argoproj/argo-workflows/blob/52cca7e079a4f6d76db303ac550b1876e51b3865/server/info/info_server.go#L54, which could be used to chain to known vulnerabilities.
Details
No authorization is performed by the Server on `client` tokens[^1]. Authorization is delegated to the k8s API server.
However, the Info Server API endpoints https://github.com/argoproj/argo-workflows/blob/52cca7e079a4f6d76db303ac550b1876e51b3865/server/info/info_server.go do not interact with k8s[^2], and so any token that _looks_ https://github.com/argoproj/argo-workflows/blob/52cca7e079a4f6d76db303ac550b1876e51b3865/server/auth/mode.go#L37 valid https://github.com/argoproj/argo-workflows/blob/52cca7e079a4f6d76db303ac550b1876e51b3865/server/auth/gatekeeper.go#L185 will be considered authenticated, even if it is not a k8s token or even if the token has no RBAC for Argo.
The same applies to any other endpoint that returns before making a Kubernetes API call. In current versions that includes `GetUserInfo`, which echoes back whatever claims the unverified token carries, `LintWorkflow`, and `CreateWorkflow` with `dryRun`. Both of the latter label the returned Workflow with a creator derived from the forged claims, and both resolve referenced templates through the Server's own informer (see GHSA-rcgr-27rh-g56w), so a forged token could be used to reach that disclosure without any Kubernetes credentials at all.
This dates back to #1965 / v2.5.0-rc1, which added the `info` endpoint. It only gave the managed namespace at the time and more information was added later, such as custom `links` in #2443 / v2.7.0-rc1, and `version` in #2740 / v2.8.0-rc2.
PoC
Following the "Access Token" documentation page https://argo-workflows.readthedocs.io/en/release-3.5/access-token/, go to the "Token Creation" section https://argo-workflows.readthedocs.io/en/release-3.5/access-token/#token-creation. Instead of retrieving a token from k8s, make a fake one with a valid prefix:
ARGO_TOKEN="Bearer faketoken"On the same page, now go down to the "Token Usage & Test" section https://argo-workflows.readthedocs.io/en/release-3.5/access-token/#token-usage-test. Instead of retrieving Workflows, retrieve the version https://github.com/argoproj/argo-workflows/blob/52cca7e079a4f6d76db303ac550b1876e51b3865/server/info/info_server.go#L54 using the fake token, which succeeds:
curl https://localhost:2746/api/v1/version -H "Authorization: $ARGO_TOKEN"
# {"version":"latest+0918598.dirty","buildDate":"2024-07-21T20:07:33Z","gitCommit":"09185982630489236303a8cb8d647c112c954008","gitTag":"untagged","gitTreeState":"dirty","goVersion":"go1.21.12","compiler":"gc","platform":"linux/amd64"}You can also retrieve some configuration data from the `info` endpoint https://github.com/argoproj/argo-workflows/blob/52cca7e079a4f6d76db303ac550b1876e51b3865/server/info/info_server.go#L39:
curl https://localhost:2746/api/v1/info -H "Authorization: $ARGO_TOKEN"
# {"managedNamespace":"argo","links":[{"name":"Workflow Link","scope":"workflow","url":"http://logging-facility?namespace=${metadata.namespace}\u0026workflowName=${metadata.name}\u0026startedAt=${status.startedAt}\u0026finishedAt=${status.finishedAt}"},{"name":"Pod Link","scope":"pod","url":"http://logging-facility?namespace=${metadata.namespace}\u0026podName=${metadata.name}\u0026startedAt=${status.startedAt}\u0026finishedAt=${status.finishedAt}"},{"name":"Pod Logs Link","scope":"pod-logs","url":"http://logging-facility?namespace=${metadata.namespace}\u0026podName=${metadata.name}\u0026startedAt=${status.startedAt}\u0026finishedAt=${status.finishedAt}"},{"name":"Event Source Logs Link","scope":"event-source-logs","url":"http://logging-facility?namespace=${metadata.namespace}\u0026podName=${metadata.name}\u0026startedAt=${status.startedAt}\u0026finishedAt=${status.finishedAt}"},{"name":"Sensor Logs Link","scope":"sensor-logs","url":"http://logging-facility?namespace=${metadata.namespace}\u0026podName=${metadata.name}\u0026startedAt=${status.startedAt}\u0026finishedAt=${status.finishedAt}"},{"name":"Completed Workflows","scope":"workflow-list","url":"http://workflows?label=workflows.argoproj.io/completed=true"}],"modals":{"feedback":true,"firstTimeUser":true,"newVersion":true},"columns":[{"name":"Workflow Completed","type":"label","key":"workflows.argoproj.io/completed"}]}While the version is perhaps the most impactful, the `info` endpoint can also expose the `managedNamespace` and `links`, both of which could also be potentially useful information to an attacker.
Patches
Fixed in v4.1.4 and v4.0.12. In `--auth-mode=client` the Server now performs a Kubernetes `SelfSubjectReview` with the presented credentials before serving any request, and rejects the request with `401 Unauthenticated` if the API server refuses the token. Successful reviews are cached for `ARGO_SERVER_TOKEN_REVIEW_CACHE_TTL` (default `1m`; `0` disables the cache). This requires Kubernetes 1.28 or later, where `SelfSubjectReview` is generally available.
v3 is not being patched. Users on v3 should upgrade.
Workarounds
Use `--auth-mode=sso`, which validates tokens itself, or restrict network access to the Server so that only trusted clients can reach it.
Impact
All users of the Server with `--auth-mode=client` are vulnerable to this information disclosure.
[^1]: `sso` tokens, on the other hand, are immediately "authorized" https://github.com/argoproj/argo-workflows/blob/52cca7e079a4f6d76db303ac550b1876e51b3865/server/auth/gatekeeper.go#L207. The naming in the codebase is a bit confusing; it would be more appropriate to say "authenticated" in this case, as authorization is via SSO RBAC / SA matching / k8s API server. In this same section of the codebase, the `client` tokens are not authenticated, they are only validated. Authentication and authorization is done simultaneously for `client` tokens via the k8s API server.
[^2]: Archived Workflows also do not retrieve information from k8s, but specifically do the equivalent of a `kubectl auth can-i` https://github.com/argoproj/argo-workflows/blob/52cca7e079a4f6d76db303ac550b1876e51b3865/server/workflowarchive/archived_workflow_server.go#L50 check for their respective methods. Archived Workflows and Info were the first API endpoints identified that do not retrieve information from k8s; Lint and dry-run Create were identified later. Rather than adding manual authorization to each, the fix validates the token itself.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
gogithub.com/argoproj/argo-workflows/v4 |
Corregida | v4.0.12, v4.1.4 | 0 d · 0 d | v4.1.6 no afectada |
gogithub.com/argoproj/argo-workflows/v3 |
Sin parche | — | — | v3.7.18 afectada |
4.0.12v4.0.124.1.4v4.1.4Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/argoproj/argo-workflows/security/advisories/GHSA-hhfc-p593-43hfLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
