GSA Bounty · Report #245872
[IDOR] The authenticated user can restart website build or view build logs on any another Federalist account
Summary
We endorse sp1d3rs's summary! The PR fixing this ticket is here: https://github.com/18F/federalist/pull/1061
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
How it was found
Description
Hi. I found an Insecure Direct Object Reference vulnerability on the http://192.168.119.128:1337/v0/build/ endpoint.
{F200108}
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: {F200109}
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.