apache / apache/pinot

[Bug] Authorization is broken for endpoints which access any resource other than a table

Open
#14,595 8 comments 0 reactions 0 assignees View on GitHub
bug security
Dominant language
Java
Stars
6.1k
Forks
1.5k
Avg merge
1d 21h
Merged PRs (30d)
189

Description

While trying [Authentication and Authorisation feature of Pinot](https://docs.pinot.apache.org/operators/tutorials/authentication), I found that for controller, any endpoint which accesses a non-table resource, authorisation does not work as expected using either of the bundled auth options:

1. BasicAuthAccessControlFactory
2. ZkBasicAuthAccessControlFactory

I would consider this a CRITICAL security flaw as it gives a normal user power to do any sort of destructive action in the cluster.

Consider a simple example.

---
Assume we have 3 users in system:

1. admin
3. test
4. user1

![Screenshot 2024-12-04 at 4 10 30 PM](https://github.com/user-attachments/assets/5bf5ad63-1a81-402b-ac6e-73b0157f0f72)

---

Now we try to DELETE _user1_ who is an admin by submitting a request as _test_ who is a normal user

![Screenshot 2024-12-04 at 11 59 26 AM](https://github.com/user-attachments/assets/e0026201-37c6-4fa4-8c59-9a1569f414f6)

Voila _user1_ is deleted! :(

---

But the user _test_ was not authorised to do so !!

![Screenshot 2024-12-04 at 3 33 13 PM](https://github.com/user-attachments/assets/c0a03601-bed1-4d6c-9ec2-fcd4f062c648)

---

This example is just tip of the iceberg. I plan to work to fix this once the team confirms this is really broken.

Contributor guide

Open the contributing guide

Research direction

Start with the controller endpoints that access non-table resources and the BasicAuthAccessControlFactory and ZkBasicAuthAccessControlFactory paths, using the linked authentication and authorization tutorial to reproduce the DELETE request as a normal user. Done means unauthorized users can no longer perform destructive actions on non-table resources, with coverage for both bundled authorization options.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
authorization, backend-api-design, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.