[IDOR] The authenticated user can restart website build or view build logs on any another Federalist account
The build restart and log endpoints did not verify that the site ID belonged to the requesting user. Any authenticated user could restart builds or view build logs for sites owned by other accounts.
- Triaged in 31 hours
- Fixed in 3 days
- Paid in 3 days
- Disclosed after 2 months
Summary by the program
We endorse sp1d3rs's summary! The PR fixing this ticket is here: https://github.com/18F/federalist/pull/1061
Summary by the researcher
Thanks to the 18F team for the great experience, fast fix, and the bounty! The report details (i requested the limited disclosure due to sensitive info in the attachments):
##Description
I found an Insecure Direct Object Reference vulnerability on the /v0/build/ and /v0/build/<siteid>/log API endpoints.
For example, when the user wants to restart the build, next request is sent to the endpoint:
{"site":<siteid>,"branch":"master"}
where siteid is numeric ID of the site. However, this endpoint does not check, do this site ID belongs to this user. So any user can restart the build of the site on any other user account.
##Steps to reproduce
- Login to the Federalist with your test account (we can call it
user1). - Restart the build of some site which belongs to you.
- Catch the request to the
http://localhost:1337/v0/build/
and change site parameter to the siteID, which was created on some other account (we can call it user2).
4. Execute the request. It will be accepted and processed.
5. Login as user2 and go to the builds page. You will notice that build was restarted by another user.
##Suggested fix Correct checking of user permissions on this endpoints should fix the issue.
##References Running Federalist locally
The report
##Description
Hi. I found an Insecure Direct Object Reference vulnerability on the http://192.168.119.128:1337/v0/build/ endpoint.

When the user wants to restart the build, next request are sent to the endpoint:
{"site":<siteid>,"branch":"master"}
where siteid is numeric ID of the site. However, this endpoint does not check, do this site ID belongs to this user. So the any user can restart the build of the site on any other user account. So it can be classified as partial authentication bypass.
##POC I restarted the build on my localhost inscance on behalf of another user:

##Steps to reproduce
- Login to the Federalist with your test account (we call it
user1). - Restart the build on one of the sites belongs to you.
- Catch the request to the
http://192.168.119.128:1337/v0/build/
and change site parameter to the siteID, which was created on some other account (we call it user2).
4. Execute the request. It will be accepted.
5. Login as user2 and go to this site's builds. You will notice that build was restarted by another user.
##Suggested fix It looks like other endpoint (e.g. site settings modify) checks the site id correctly. The fix is add additional check too on this specific endpoint.
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
The build endpoints accepted a site ID and acted on it without verifying that the authenticated user owned that site.
Impact
An authenticated user could restart builds or view build logs for another user's site.
What the attacker needed
A test account; knowledge of another user's site ID
The fix
The endpoints should check that the authenticated user owns the site ID before allowing the action; the text links a pull request that fixes the issue.
How it was found
- Log in with a test account (user1).
- Restart the build of a site that belongs to user1.
- Capture the request to the build endpoint and change the site parameter to a site ID owned by another account (user2).
- Send the modified request; it is accepted and processed.
- Log in as user2 and check the builds page to see the build was restarted by another user.
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.
An IDOR (Insecure Direct Object Reference) happens when a website uses an identifier like a number to pick a record but forgets to check that the person asking is allowed to see or change that record. Here, the site ID was trusted without checking ownership, so one user could act on another user's site.
What is IDOR?
One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.