Skip to content
Access control Disclosed report Intermediate

Improper authorization on `/api/as/v1/credentials/` for Dev Role User with Limited Engine Access

A user with the Dev role and Limited Engine Access could still call the credentials API endpoint and retrieve all API keys, including private keys. This let a low-privileged user escalate privileges and use those keys to create or delete API keys.

superman85 Follow with dee-see

Originally disclosed on HackerOne

  • Triaged in 45 hours
  • Fixed in 36 days
  • Paid in 8 days
  • Disclosed after 58 days

Summary: Dear Team,

Since #1168528 was resolved. I have checking again for other roles. At Dev Role with Limited Engine Access, an user still can access API endpoint /api/as/v1/credentials/ to get all API keys (private-key, search-key ... )

Steps To Reproduce:

1 - Log in Kibana with the admin (elastic) user and go to the Stack Management > Users page (/app/management/security/users/) 2 - Choose an username , password and role for this user. For example you can choose username: dev 3 - Log in App Search with the admin (elastic) user and go to the Users & roles page (/as#/role-mappings/) 4 - Click Add mapping 5 - External Attribute choose username , in the Attribute value field enter dev 6 - In the Role box select Dev 7 - In Engine Access select Limited Engine Access, no need to select any engine 8 - Login to App Search with user dev 9 - Go to endpoint https://your_app_search_instance/api/as/v1/credentials/ 10 - You still can get all api keys

I have attached video PoC █████████

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.

With Limited Engine Acess, an user should create and managed their own api keys

The original report as published on HackerOne, by superman85. 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

Root cause

Likely the credentials endpoint checked that the caller was logged in but did not check the caller's role or engine access before returning all keys.

Impact

A limited user could escalate privileges and, if a Private Admin Key existed, use it to create new API keys or delete existing ones.

What the attacker needed

An account with the Dev role; Limited Engine Access mapping; access to the App Search instance

How it was found

  1. Create a Kibana user with a chosen username, password and role.
  2. In App Search, add a role mapping for that username with the Dev role.
  3. Set Engine Access to Limited Engine Access without selecting any engine.
  4. Log in to App Search as that user.
  5. Request the credentials endpoint and observe that all API keys are returned.

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 gives out API keys that act like passwords for the service. A user who should only manage their own keys could ask the server for every key, including powerful admin ones. With those keys they could do things they were never meant to do.

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 superman85

View all

6 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.