Tales of sharepoint API misconfigurations
SharePoint REST API endpoints exposed list data and files to users who should not have access, and a custom SPService.aspx GetItems endpoint allowed bypassing access controls by removing filters. An attacker could retrieve sensitive information such as credentials, audit logs, and internal hostnames.
medium.com
Published on medium.com
I currently work as a Penetration Tester but never really had any bug bounty experience. While working on a project, I stumbled upon something interesting in sharepoint applications, so I thought I would make my first attempt by sharing this information.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely missing or inconsistent access-control checks on SharePoint REST API endpoints and a custom SPService.aspx GetItems endpoint that did not enforce the same restrictions as direct requests.
Impact
An attacker could retrieve sensitive information such as FTP credentials, emails, audit logs, and internal hostnames that were not intended to be accessible to their user account.
What the attacker needed
Access to a SharePoint application; ability to send API requests
The fix
Access controls should be enforced consistently on all SharePoint REST API endpoints and custom API components, including when filters are removed.
How it was found
- Request the lists endpoint to enumerate available lists and their GUIDs.
- Use the list title or GUID with the items endpoint to fetch list items.
- Use folder and file endpoints to list and download files such as audit logs.
- Intercept the SPService.aspx GetItems POST request and remove the filters.
- Observe that data becomes accessible through the API even though a direct GET request was denied.
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 write-up has not been written yet. The Original tab links to the source.
SharePoint is a Microsoft tool for sharing documents and lists. Its web API lets you ask for data directly, and if permissions are not checked properly, someone can ask for lists or files they should not see. The author also found a custom API that ignored the normal access checks when filters were removed.
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.