Authenticated but unauthorized users may enumerate Application names via the API
Argo CD returned different API errors depending on whether an application existed, so a logged-in user without permission could tell which application names were real. An attacker could then use those names as a starting point for further attacks, such as social engineering an administrator.
Originally disclosed on HackerOne
- Triaged in 7 hours
- Fixed in 32 days
- Paid in 32 days
- Disclosed after 2 months
Summary by the program
Authenticated but unauthorized users may enumerate Application names via the API
Impact All versions of Argo CD starting with v0.5.0 are vulnerable to an information disclosure bug allowing unauthorized users to enumerate application names by inspecting API error messages. An attacker could use the discovered application names as the starting point of another attack. For example, the attacker might use their knowledge of an application name to convince an administrator to grant higher privileges (social engineering).
Many Argo CD API endpoints accept an application name as the only parameter. Since Argo CD RBAC requires both the application name and its configured project name (and, if apps-in-any-namespace is enabled, the application's namespace), Argo CD fetches the requested application before performing the RBAC check. If the application does not exist, the API returns a "not found". If the application does exist, and the user does not have access, the API returns an "unauthorized" error. By trial and error, an attacker can infer which applications exist and which do not.
Note that application resources are not fetched for API calls from unauthenticated users. If your Argo CD instance is accessible from the public internet, unauthenticated users will not be able to cause Argo CD to make Kubernetes API calls.
The patch changes API behavior to return "unauthorized" both when the application is missing and when the user is not authorized to access it. This change in API behavior may impact API clients. Check your code to make sure it will handle the new API behavior properly.
Patches A patch for this vulnerability has been released in the following Argo CD versions:
v2.6.7 v2.5.16 v2.4.28 Workarounds There are no workarounds besides upgrading.
Credits Thank you to bean.zhang of HIT-IDS ChunkL Team who discovered the issue and reported it confidentially according to our guidelines.
Full GHSA: https://github.com/argoproj/argo-cd/security/advisories/GHSA-2q5c-qw9c-fmvq
The report
All versions of Argo CD starting with v0.5.0 are vulnerable to an information disclosure bug allowing unauthorized users to enumerate application names by inspecting API error messages.
STEPS:
- Login argocd with a user who has not application module's priviledge.
- The user request 'api/v1/application/**/logs' restful api to download a log file.
- The log file's content lead a information disclosure bug, which allowing unauthorized users to enumerate application names by inspecting API error messages. The error messages like 'error gettingg applicaiton by name: ** not found'.
Impact
An attacker could use the discovered application names as the starting point of another attack. For example, the attacker might use their knowledge of an application name to convince an administrator to grant higher privileges (social engineering).
Attachments
Context
Argo CD is a GitOps continuous delivery tool for Kubernetes, and its API is the interface through which the UI and CLI drive applications. Many of those API endpoints take an application name as their only parameter. Argo CD's RBAC model, however, needs more than the name to decide whether a caller may see an application: it needs the application's configured project name, and, when the apps-in-any-namespace feature is enabled, the application's namespace as well.
The vulnerability described here is an information disclosure issue in that API. Authenticated but unauthorised users can enumerate application names by inspecting API error messages. All versions of Argo CD starting with v0.5.0 are affected.
Setup
The precondition is an account on the Argo CD instance that is authenticated but has no privileges on the application module. The researcher logged in with such a user and then called the application API directly. No special tooling is described beyond making REST calls against the instance.
Finding it
The API's error responses differ depending on whether an application exists. Because Argo CD has to fetch the requested application before it can perform the RBAC check (the check needs the project name, and possibly the namespace, which are only known once the object is loaded), the fetch happens first. That ordering leaks existence:
- If the application does not exist, the API returns a "not found".
- If the application does exist and the user is not authorised, the API returns an "unauthorized" error.
By trial and error, an attacker can therefore infer which applications exist and which do not.
Exploitation
Step 1: log in with an unprivileged user
Log in to Argo CD with a user who has no privileges on the application module. This user is authenticated, so the API will process their requests, but they are not authorised to read applications.
Step 2: request an application endpoint
The user requests the application logs endpoint to download a log file:
api/v1/application/**/logs
The ** stands for the application name being probed. The endpoint accepts the application name as its only parameter, which is what makes it usable as an oracle.
Step 3: read the error message
The content returned for the request leaks whether the named application exists. The error messages look like:
error gettingg applicaiton by name: ** not found
A "not found" for a name means no such application exists. A different response, an "unauthorized" error, means the application does exist but the caller may not access it. Repeating the request with different names turns this difference into an enumeration primitive.
The report includes an attached video:
Root cause
The design mistake is the order of operations. Argo CD fetches the requested application before performing the RBAC check, because the check requires the application's project name (and, with apps-in-any-namespace enabled, its namespace), which are only available from the fetched object. The fetch result is then reflected in the error returned to the caller: a missing object produces "not found", while an existing object the caller may not access produces "unauthorized". The two outcomes are distinguishable, so the error message becomes an existence oracle.
One limit matters: application resources are not fetched for API calls from unauthenticated users. If an Argo CD instance is reachable from the public internet, unauthenticated users cannot cause Argo CD to make Kubernetes API calls. The leak requires an authenticated account.
Impact
An attacker with an authenticated but unprivileged account can enumerate application names. Those names can then serve as the starting point of another attack. For example, the attacker might use knowledge of an application name to convince an administrator to grant higher privileges, a social engineering angle. The severity assigned to the report is medium (CVSS 5.3), and the weakness is classified as information exposure through an error message.
Fix
The patch changes the API behaviour so that it returns "unauthorized" both when the application is missing and when the user is not authorised to access it. Because this changes API behaviour, the advisory warns that API clients may be affected and asks operators to check their code handles the new behaviour properly.
The fix was released in the following Argo CD versions:
- v2.6.7
- v2.5.16
- v2.4.28
There are no workarounds besides upgrading.
Variants to test
- Probe other endpoints that take an application name as their only parameter and compare responses for existing versus non-existing names. A positive result is any pair of responses that lets you tell the two cases apart, such as "not found" versus "unauthorized".
- Try the same pattern on endpoints that take other object names (projects, clusters, repositories) where the authorisation check needs data from the fetched object. A positive result is a stable difference in status or message between a missing object and an object you may not access.
- Compare error bodies, not just status codes, since the leak here is carried in the message text. A positive result is a message that names the object or states its existence.
- Check behaviour with apps-in-any-namespace enabled, where the namespace is part of the authorisation input. A positive result is a response that reveals existence across namespaces you cannot access.
Hunting notes
This kind of bug tends to hide wherever an application fetches an object before it can decide whether the caller is allowed to see it, and then reports the fetch outcome to the caller. The signal during recon is an API whose authorisation depends on attributes of the object itself (project, namespace, owner), because that forces a fetch ahead of the check. Look for endpoints that accept a single object name and return distinct errors for missing versus forbidden objects.
The report explains how discovered names feed a follow-on attack, here social engineering an administrator into granting higher privileges. The report notes that unauthenticated users cannot trigger the Kubernetes API calls, so the leak is limited to authenticated accounts.
What happened, in plain words
Argo CD is a tool that helps teams deliver software to their servers automatically. It keeps a list of "applications", which are the pieces of software it manages, and it offers an API so that its web page and command-line tool can talk to it. An API is the set of addresses a program exposes so other programs can ask it questions or tell it to do things, a bit like a restaurant menu: you can only order what is listed, and the kitchen answers in a fixed way.
Many of those API addresses take just one piece of information: the name of an application. To decide whether a caller is allowed to see an application, Argo CD needs more than the name. It needs the application's project name, and, if a feature called apps-in-any-namespace is switched on, the application's namespace as well. A namespace is a way of dividing a shared system into separate labelled areas, like floors in an office building.
Because of that, Argo CD first looks up the application, then checks permissions. That order is the problem. If the application does not exist, the API answers "not found". If it does exist but the caller is not allowed to see it, the API answers "unauthorized". Those two answers are different, so a curious user can try names one by one and learn which applications exist. This kind of bug is called information disclosure: the system gives away a fact it should keep quiet. Here the fact leaks through an error message, which is why the weakness is classified as information exposure through an error message.
All versions of Argo CD starting with v0.5.0 are affected. The report was rated medium severity, with a CVSS score of 5.3. CVSS is a standard scoring system for how serious a security flaw is, where a higher number means more risk.
Context
Argo CD is a GitOps continuous delivery tool for Kubernetes. GitOps means the desired state of your systems is kept in a Git repository, and the tool makes the live systems match it. Kubernetes is the platform that runs and manages containers, the packaged pieces of software. Argo CD's API is the interface through which its web page and command-line tool drive applications.
Many of those API endpoints take an application name as their only parameter. An endpoint is one specific address on the API, like one page of a website. A parameter is a value you supply with the request, here the name of the application you are asking about.
Argo CD's RBAC model, however, needs more than the name to decide whether a caller may see an application. RBAC stands for role-based access control: each user has a role, and each role is allowed to do certain things. To make that decision, Argo CD needs the application's configured project name, and, when the apps-in-any-namespace feature is enabled, the application's namespace as well. A project is a grouping inside Argo CD that bundles related applications together.
The vulnerability described here is an information disclosure issue in that API. Authenticated but unauthorised users can enumerate application names by inspecting API error messages. Authenticated means the user has logged in and proved who they are. Unauthorised means that, despite being logged in, they are not allowed to do the thing they are asking for. To enumerate means to list things one by one, here by guessing names and watching the answers.
Setup
The precondition is an account on the Argo CD instance that is authenticated but has no privileges on the application module. The application module is the part of Argo CD that deals with applications. The researcher logged in with such a user and then called the application API directly. No special tooling is described beyond making REST calls against the instance. REST is a common style of API where each address represents a thing, and you use standard web requests to read or change it.
Finding it
The API's error responses differ depending on whether an application exists. Because Argo CD has to fetch the requested application before it can perform the RBAC check (the check needs the project name, and possibly the namespace, which are only known once the object is loaded), the fetch happens first. That ordering leaks existence:
- If the application does not exist, the API returns a "not found".
- If the application does exist and the user is not authorised, the API returns an "unauthorized" error.
By trial and error, an attacker can therefore infer which applications exist and which do not. Think of a receptionist who first checks whether a person works in the building and only then checks whether you are allowed to visit them: the wording of the refusal tells you whether the person exists.
Exploitation
Step 1: log in with an unprivileged user
Log in to Argo CD with a user who has no privileges on the application module. This user is authenticated, so the API will process their requests, but they are not authorised to read applications. This step matters because the leak only happens for logged-in callers: the system has to know who you are before it bothers to look anything up.
Step 2: request an application endpoint
The user requests the application logs endpoint to download a log file:
api/v1/application/**/logs
This is the address the user asks the API for. api/v1 is the versioned part of the API, the fixed prefix that says which API and which version you are talking to. application says you are asking about an application. ** stands for the application name being probed, the part the attacker changes on each attempt. logs asks for that application's log file, the running record of what the software has been doing. The endpoint accepts the application name as its only parameter, which is what makes it usable as an oracle. An oracle here means any source of answers that lets you learn a hidden fact by asking questions.
Step 3: read the error message
The content returned for the request leaks whether the named application exists. The error messages look like:
error gettingg applicaiton by name: ** not found
This is the text of the error the API sends back. error gettingg applicaiton by name is the API's own wording, spelling mistakes included, saying it failed while trying to fetch an application by its name. ** is where the name the attacker supplied appears. not found is the key part: it tells the caller that no application with that name exists. A "not found" for a name means no such application exists. A different response, an "unauthorized" error, means the application does exist but the caller may not access it. Repeating the request with different names turns this difference into an enumeration primitive. A primitive, in security writing, is a small reliable building block that an attacker can repeat to achieve something bigger.
The report includes an attached video:
Root cause
The design mistake is the order of operations. Argo CD fetches the requested application before performing the RBAC check, because the check requires the application's project name (and, with apps-in-any-namespace enabled, its namespace), which are only available from the fetched object. The fetch result is then reflected in the error returned to the caller: a missing object produces "not found", while an existing object the caller may not access produces "unauthorized". The two outcomes are distinguishable, so the error message becomes an existence oracle.
One limit matters: application resources are not fetched for API calls from unauthenticated users. If an Argo CD instance is reachable from the public internet, unauthenticated users cannot cause Argo CD to make Kubernetes API calls. The leak requires an authenticated account. In other words, a stranger with no login gets nothing useful, because the system does not even go and look.
Impact
An attacker with an authenticated but unprivileged account can enumerate application names. Those names can then serve as the starting point of another attack. For example, the attacker might use knowledge of an application name to convince an administrator to grant higher privileges, a social engineering angle. Social engineering means manipulating a person rather than a machine, for instance by sounding knowledgeable and trustworthy because you can name real systems. The severity assigned to the report is medium (CVSS 5.3), and the weakness is classified as information exposure through an error message.
Fix
The patch changes the API behaviour so that it returns "unauthorized" both when the application is missing and when the user is not authorised to access it. A patch is a small update that repairs a flaw. After the fix, the two cases look identical from the outside, so the answer no longer tells the caller whether the name exists. Because this changes API behaviour, the advisory warns that API clients may be affected and asks operators to check their code handles the new behaviour properly. An API client is any program that talks to the API, and code that relied on telling "not found" apart from "unauthorized" will now see one answer for both.
The fix was released in the following Argo CD versions:
- v2.6.7
- v2.5.16
- v2.4.28
There are no workarounds besides upgrading. A workaround is a temporary way to reduce the risk without installing the official fix, and here there is none.
Variants to test
- Probe other endpoints that take an application name as their only parameter and compare responses for existing versus non-existing names. A positive result is any pair of responses that lets you tell the two cases apart, such as "not found" versus "unauthorized".
- Try the same pattern on endpoints that take other object names (projects, clusters, repositories) where the authorisation check needs data from the fetched object. A positive result is a stable difference in status or message between a missing object and an object you may not access.
- Compare error bodies, not just status codes, since the leak here is carried in the message text. A status code is the short number a web server sends with every answer, such as 200 for success or 404 for not found; the body is the rest of the answer, the actual content. A positive result is a message that names the object or states its existence.
- Check behaviour with apps-in-any-namespace enabled, where the namespace is part of the authorisation input. A positive result is a response that reveals existence across namespaces you cannot access.
Hunting notes
This kind of bug tends to hide wherever an application fetches an object before it can decide whether the caller is allowed to see it, and then reports the fetch outcome to the caller. The signal during recon is an API whose authorisation depends on attributes of the object itself (project, namespace, owner), because that forces a fetch ahead of the check. Recon, short for reconnaissance, is the early phase of looking around a system to understand how it is built. Look for endpoints that accept a single object name and return distinct errors for missing versus forbidden objects.
The report explains how discovered names feed a follow-on attack, here social engineering an administrator into granting higher privileges. The report notes that unauthenticated users cannot trigger the Kubernetes API calls, so the leak is limited to authenticated accounts.
Glossary
- API: the set of addresses a program exposes so other programs can ask it questions or tell it to do things.
- Endpoint: one specific address on an API, like one page of a website.
- Parameter: a value you supply with a request, such as the name of the application you are asking about.
- Argo CD: a GitOps continuous delivery tool for Kubernetes that manages applications.
- GitOps: a way of working where the desired state of systems is kept in a Git repository and tools make the live systems match it.
- Kubernetes: the platform that runs and manages containers, the packaged pieces of software.
- Container: a packaged piece of software that runs in isolation on a shared system.
- Application (in Argo CD): a piece of software that Argo CD manages.
- Project (in Argo CD): a grouping inside Argo CD that bundles related applications together.
- Namespace: a way of dividing a shared system into separate labelled areas, like floors in an office building.
- apps-in-any-namespace: an Argo CD feature that lets applications live in different namespaces, which then becomes part of the permission check.
- RBAC: role-based access control, where each user has a role and each role is allowed to do certain things.
- Authenticated: having logged in and proved who you are.
- Unauthorised: being logged in but not allowed to do the thing you are asking for.
- Information disclosure: a bug where a system gives away a fact it should keep quiet.
- Information exposure through an error message: the specific class of information disclosure where the leaked fact appears in an error message.
- Enumerate: to list things one by one, here by guessing names and watching the answers.
- Oracle: any source of answers that lets you learn a hidden fact by asking questions.
- Primitive: a small reliable building block that an attacker can repeat to achieve something bigger.
- REST: a common style of API where each address represents a thing and standard web requests are used to read or change it.
- Status code: the short number a web server sends with every answer, such as 200 for success or 404 for not found.
- Body: the rest of a server's answer, the actual content beyond the status code.
- Log file: the running record of what a piece of software has been doing.
- CVSS: a standard scoring system for how serious a security flaw is, where a higher number means more risk.
- Patch: a small update that repairs a flaw.
- Workaround: a temporary way to reduce risk without installing the official fix.
- API client: any program that talks to an API.
- Social engineering: manipulating a person rather than a machine, for instance by sounding knowledgeable and trustworthy.
- Recon: reconnaissance, the early phase of looking around a system to understand how it is built.