Privilege Escalation in Edit and Create Secret Endpoints Leads to Unauthorized Secret Modification
A user with the Builder role could list all secret names in a workspace and create or overwrite secrets by sending requests to the secrets API. This allowed them to tamper with application configurations and potentially escalate privileges.
- Disclosed after 48 hours
#Summary
A user with the **Builder** role — a role that is **not expected** to manage secrets — can:
- �
**List all existing secret names** in the workspace.
- �
**Create new secrets**.
- �
**Overwrite existing secrets** simply by using the same name.
This behavior **violates permission boundaries** and leads to **privilege escalation**, **tampering with app configurations**, or **unauthorized access to sensitive data**.
---
# Steps to Reproduce
##Step-1 : Get All Secret Names in the Workspace
As a **Builder**, send a `GET` request to the secrets endpoint to enumerate all existing secret names.
```http
GET /api/w/[workspace_id]/dust_app_secrets HTTP/2
Host: dust.tt
Cookie: [appSession]
```
This returns a list of secrets with their `id`, `name`, `created_at`, etc. — but without showing the secret `value`.
```json
{
"secrets": [
{ "name": "NAME-1", "value": "•••••••" },
{ "name": "NAME-2", "value": "•••••••" }
]
}
```
##**Step-2 :** Create or Overwrite a Secret
Now, send a `POST` request to create a new secret.
```json
POST /api/w/[workspace_id]/dust_app_secrets HTTP/2
Host: dust.tt
Content-Type: application/json
Cookie: [appSession]
{
"name": "NAME-1",
"value": "malicious-value"
}
```
#### Behavior:
- If the `name` used in the request **already exists** in the workspace (as returned from step 1), the system will **overwrite the existing secret's value**.
- If the `name` is **new**, a new secret will be created.
- No error or warning is shown — overwrite happens silently.
---
#POC Video:
██████
---
# Expected Behavior
The **Builder** role should:
- Not be able to access the list of secret names.
- Not be able to create or update any secrets.
---
# Suggested Fix
- Enforce strict permission checks on all secret-related endpoints.
- Ensure only users with elevated roles (e.g., Admin, Owner) can list, create, or update secrets.
## Impact
This vulnerability allows users with the **Builder** role to:
- Discover all secret names in the workspace.
- Tamper with or overwrite secrets used by other users or apps.
- Create new secrets and potentially trick other users into using them.
- Escalate privileges by modifying secrets used in sensitive flows (e.g., API keys, tokens, credentials).
This could lead to:
- Configuration manipulation
- Account compromise
- Supply chain attacks on internal tooling
- Loss of integrity of secret dataNot 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 secret management endpoints did not enforce proper role-based access control, allowing users with the Builder role to perform actions reserved for higher-privileged roles.
Impact
This could lead to configuration manipulation, account compromise, supply chain attacks on internal tooling, and loss of integrity of secret data.
What the attacker needed
A Builder role account
How it was found
- As a Builder, send a GET request to the secrets endpoint to list all secret names.
- Send a POST request with a secret name and a new value to create or overwrite a secret.
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.
In many apps, users have different roles with different permissions. Here, a 'Builder' role, which should only build things, was able to see the names of all secrets (like passwords or API keys) and even replace their values. This means someone with limited access could mess with sensitive settings.
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.