Skip to content
Access control Disclosed report Beginner

Improper authorization on `/api/as/v1/credentials/` allows any App Search user to access all API keys and escalate privileges

The API endpoint for listing credentials did not enforce role-based access control, so any authenticated App Search user, even with the lowest role, could retrieve all API keys. An attacker could use a leaked private admin key to create or delete API keys, escalating privileges.

dee-see Follow

Originally disclosed on HackerOne

High 8.8 View original
  • Triaged in 5 hours
  • Fixed in 35 days
  • Paid in 5 hours
  • Disclosed after 44 days

Summary

Hello team, I hope you're doing well! App Search has a credentials page located at /as#/credentials that lists all the API keys a user has access to, if any. That same page will 404 for users with Analyst or Editor role. This is all working as intended, however there is also an API endpoint to query that same data at /api/as/v1/credentials/ and this will list all existing API keys for any authenticated user regardless of their App Search role.

Steps to reproduce

I'm going to use the cloud environment for the reproduction

Preparation

  1. Log in App Search with the admin (elastic) user and go to the Users & roles page (/as#/role-mappings/)
  2. Click Add mapping
  3. In the Attribute value field enter h1-repro
  4. In the Role box select Analyst
  5. In the Engine Access select Limited Engine Access, no need to select any engine
    • We now have created the most limited role possible
  6. Log in Kibana with the admin (elastic) user and go to the Stack Management > Users page (/app/management/security/users/)
  7. Click Create user
  8. In the Username field enter hi-repro
  9. Set any password you like and then click Create user

Reproduction

  1. Log in App Search with the h1-repro user
  2. Navigate to /as#/role-mappings/ and observe that it's a 404 because you don't have access to this page
  3. Navigate to /api/as/v1/credentials/ and observe that you have access to all the API keys

Impact

Privilege escalation. The default App Search install has a Private API Key with read/write access to all engines. If a Private Admin Key has been created before. the attacker can use it to create new API keys or delete existing ones.

The original report as published on HackerOne, by dee-see. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

Impact

An attacker with any authenticated account could obtain all API keys, and if a private admin key exists, use it to create or delete API keys, leading to privilege escalation.

What the attacker needed

An authenticated App Search account

How it was found

  1. As admin, create a role mapping for attribute value 'h1-repro' with Analyst role and limited engine access.
  2. As admin, create a new user 'hi-repro' with any password.
  3. Log in as 'hi-repro' and confirm the role-mappings page returns 404.
  4. Navigate to /api/as/v1/credentials/ and observe all API keys are listed.

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.

App Search has different user roles that control what you can see and do. The web page for credentials correctly blocked low-privilege users, but the underlying API did not check roles, so anyone logged in could fetch all API keys. API keys are like passwords that grant access to the system, so leaking them is dangerous.

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.

More by dee-see

View all

9 more disclosed reports, best first.

More from Elastic

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.