Argo CD reconciles apps outside configured namespaces when sharding is enabled
When sharding is enabled, the Argo CD Application controller fails to enforce the configured list of allowed namespaces when reconciling Applications. A malicious Argo CD user could therefore deploy Applications outside the permitted namespaces.
- Triaged in 21 hours
- Fixed in 9 days
- Paid in 9 days
- Disclosed after 39 days
Summary by the program
Controller reconciles apps outside configured namespaces when sharding is enabled
Impact All Argo CD versions starting with 2.5.0-rc1 are vulnerable to an authorization bypass bug which allows a malicious Argo CD user to deploy Applications outside the configured allowed namespaces.
Description of exploit Reconciled Application namespaces are specified as a comma-delimited list of glob patterns. When sharding is enabled on the Application controller, it does not enforce that list of patterns when reconciling Applications. For example, if Application namespaces are configured to be argocd-*, the Application controller may reconcile an Application installed in a namespace called other, even though it does not start with argocd-.
Reconciliation of the out-of-bounds Application is only triggered when the Application is updated, so the attacker must be able to cause an update operation on the Application resource.
Credits Thanks to ChangZhuo Chen (@czchen) for finding the issue and for contributing the fix!
Full GHSA: https://github.com/argoproj/argo-cd/security/advisories/GHSA-6p4m-hw2h-6gmw
The report
The Application CRD outside configured namespace in Argo CD will be reconciled.
The following is how to reproduce the vulnerability:
- Enable
apps-in-any-namespaceandshardingfeatures. - Create an Application CRD in namespace not configured in Argo CD.
- Update the Application CRD, and Argo CD will reconcile the Application CRD, despite not in configured namespace.
Impact
Attacker can use Argo CD permission to deploy resources in Kubernetes.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the Application controller's sharding code path skips the namespace glob-pattern check that is applied in the non-sharded path.
Impact
An attacker with Argo CD permissions could deploy resources in Kubernetes outside the configured allowed namespaces; reconciliation only happens when the Application is updated, so the attacker must be able to trigger an update.
What the attacker needed
Sharding feature enabled; apps-in-any-namespace feature enabled; attacker can create and update an Application; attacker has Argo CD permissions
The fix
A fix was contributed by the credited reporter, though the text does not confirm it was applied.
How it was found
- Enable the apps-in-any-namespace and sharding features.
- Create an Application resource in a namespace that is not in the configured allowed list.
- Update that Application resource.
- Argo CD reconciles the Application even though its namespace is not allowed.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Argo CD is a tool that deploys applications into Kubernetes clusters. Administrators can restrict which namespaces (separate areas of the cluster) Argo CD is allowed to manage. This bug means that when a performance feature called sharding is turned on, Argo CD ignores that restriction and can manage applications in other namespaces too.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.