My Autonomous Hunt Harness Found a Critical BOLA That Let Any Authenticated User Write to a Shared…
The server accepted client-supplied object identifiers for a shared production document library without checking that the object belonged to the authenticated user's vendor entity. An authenticated user with no assigned entity could read the shared library root, obtain an upload session, create a file, and delete a document by its ID.
Published on medium.com
Cybersecurity
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.
Context
The target was a third-party compliance application built around vendor entities. Users belong to a vendor entity, each entity has a folder, and each folder holds that vendor's documents. The production document store was a shared SharePoint library with one folder per vendor, accessed by the backend through Microsoft Graph.
The application's React client enforced the intended model: it showed a user only the objects belonging to their own entity, and the API calls made through the UI looked normal. The question the hunt turned on was whether the server independently verified that a client-supplied object ID belonged to the authenticated user, or whether it simply trusted the ID.
Setup
The testing was driven by an autonomous bug-hunting harness rather than manual clicking. The workflow ran through application discovery, API extraction, endpoint classification, object-ID identification, an authorization hypothesis, an authenticated baseline, object substitution, cross-object response comparison, fallback and error-path analysis, safe write validation, safe delete validation, and finally manual confirmation.
The key precondition was an authenticated account with no assigned vendor entity. Such an account should logically have no vendor folder and no vendor documents, so if the server enforced ownership correctly there would be no meaningful production document scope available to it.
Finding it
The harness identified a set of object-based endpoints under:
/api/Entity/*
including operations conceptually equivalent to:
GetEntityInfoAndDDQByIdGetRootWhenErrorCreateUploadSessionDeleteDocumentById
Several of these accepted object identifiers supplied by the client, either as a query parameter:
?id=<object-id>
or in a JSON body:
{ "fileId": "<object-id>"}
That pattern alone creates a BOLA hypothesis: an authenticated user supplies an object ID, and the question is whether the server verifies ownership before acting on it. The client-side filtering in the React UI was irrelevant to that question, because the browser is not a security boundary and an attacker can change the identifier before sending the request.
The first concrete signal came from an error path. A request for an entity that does not exist:
GET /api/Entity/GetEntityInfoAndDDQById?id=00000000-0000-0000-0000-000000000000
produced an error response, which by itself was unremarkable. But the application had a secondary fallback endpoint:
GET /api/Entity/GetRootWhenError
Calling the fallback returned the shared production library root. The response exposed a root object similar to:
id = [redacted]
with a child count of approximately:
1494
That was the first strong indication that the account's effective scope was not limited to its own entity: the application was returning the shared production root to a user with no assigned entity. The fallback path had become an authorization boundary of its own.
Exploitation
Step 1: Confirm the shared root through the fallback
The zero GUID request to GetEntityInfoAndDDQById fails; calling GetRootWhenError returns the production library root with its ID and a child count of roughly 1494. This establishes that an account with no entity can read shared library metadata.
Step 2: Supply the shared root as fileId to the upload endpoint
The next question was whether the flaw extended beyond metadata to write operations. The upload endpoint accepted a client-supplied fileId:
POST /api/Entity/CreateUploadSession
with a body conceptually equivalent to:
{ "fileName": "<probe-file>", "fileId": "[redacted]"}
The supplied ID was the shared production root, not an entity owned by the current user. The server responded with an upload session. That was the critical authorization signal: no ownership validation stood between the client-supplied ID and the grant.
Step 3: Note what the upload response contains
The upload response contained a pre-authenticated Microsoft Graph/SharePoint upload URL. The application was acting as a privileged intermediary: the authenticated user does not need direct SharePoint permissions, because the application's service principal holds the powerful permissions and calls Graph on the user's behalf. When the application fails to enforce object-level authorization before that call, the user inherits a capability far broader than intended.
Step 4: Complete the write with a benign probe
To show the capability was real rather than theoretical, the harness completed the upload using a clearly labelled benign probe file. The server-side result was:
HTTP 201 Created
The production library's child count increased. The sequence was: authenticated account, shared root ID supplied, upload session granted, benign probe uploaded, HTTP 201, library count increased. That is an actual write primitive.
Step 5: Test deletion with the probe's own ID
The delete endpoint accepted a document ID:
POST /api/Entity/DeleteDocumentById?id=<driveItemId>
No real vendor document was touched. The harness supplied the ID of the benign probe file it had just created. The API returned:
HTTP 200
The library child count decreased back to its original value. The full sequence was a baseline of childCount = N, creation of the probe giving childCount = N + 1, deletion of the probe returning to childCount = N, a net-zero footprint. This showed the authorization problem affected write and delete, not only read.
Step 6: Assemble the end-to-end chain
The verified chain was: authenticated user with no assigned vendor entity, fallback endpoint, shared production root exposed, root ID supplied to the upload endpoint, no ownership validation, upload URL granted, benign file created, delete endpoint accepts the object ID, benign file deleted, production state restored.
The server trusted the object ID supplied by the client instead of deriving and enforcing the user's authorized object scope.
Root cause
The application exposed object references (fileId, driveItem ID, entity GUID) and failed to verify, server-side, that the referenced object belonged to the authenticated user's authorized entity before making the privileged Graph/SharePoint call. The vulnerable pattern is the classic one:
GET /api/document?id=123
where the backend effectively does:
find(123)return object
instead of checking ownership first:
object = find(123)
if object.owner != current_user: deny()return object
The intended architecture should have been: authenticated user, determine authorized entity, determine authorized folder, verify the requested object belongs to that folder, then call SharePoint or Graph. Instead the flow was: authenticated user, client supplies object ID, backend trusts the object ID, ownership check missing, privileged service principal, shared production library.
The vendor-level isolation was maintained in the React client, which can determine which folder a user should interact with but cannot enforce anything. The fallback endpoint (GetRootWhenError) exposed the same underlying resource without the checks applied to the normal path, and the privileged service principal meant the backend had the reach to act on whatever ID it was given. The service identity amplified the impact of the missing check.
Impact
The issue was assessed as Critical, with a CVSS 3.1 score of 9.1. An authenticated user with no assigned vendor entity could read shared library metadata, obtain an upload grant for the shared production library, create a file in it, and delete a document by object ID. The flaw was systemic rather than a single isolated endpoint issue.
If an attacker obtained a valid object identifier belonging to another vendor, the missing check could potentially allow operations against that object: reading vendor compliance information, document tampering or malicious file placement, and destruction of compliance records. The production library contained approximately 1,493 vendor folders, so the failure was potentially systemic rather than isolated to one account, and because the application operated through a privileged backend identity the blast radius could extend across the shared production document store.
Self-registration was not the vulnerability. It mattered only because it established reachability: an internet user registers, gets an authenticated session, and reaches the vulnerable API. The application successfully authenticated the user; it failed to enforce what that user was allowed to access.
The write and delete capability was demonstrated only with a benign probe file that was created and immediately deleted. No real vendor document was modified or deleted. The harness deliberately did not read real vendor documents in bulk, modify real vendor records, delete real vendor documents, overwrite vendor compliance files, plant malicious content in vendor folders, or enumerate sensitive vendor data unnecessarily, because none of that was required to establish the authorization failure.
Fix
The primary fix is to enforce authorization server-side for every object reference. Every endpoint accepting fileId, driveItem ID, entity GUID, folderId or documentId should verify that the object belongs to the authenticated user's authorized entity before making the privileged Graph/SharePoint call. Conceptually:
user_entity = get_authorized_entity(current_user)
obj = get_object(object_id)if obj.entity_id != user_entity.id: raise Forbidden()perform_operation(obj)
The exact implementation depends on the data model, but the security property must hold: authenticated user, authorized entity, requested object.
Additional recommendations from the report:
- Protect fallback endpoints. Endpoints such as
GetRootWhenErrorandGetChildrenWhenErrorshould be removed or subjected to the same authorization checks as their normal equivalents. - Do not rely on client-side filtering. React and UI logic can improve usability but must never be the authoritative authorization mechanism.
- Minimise service-principal permissions so the backend identity has only the permissions necessary for the operation.
- Consider stronger tenant isolation, separating vendor data at the storage or permission boundary instead of placing all vendor documents behind one highly privileged service identity.
- Audit every object-based endpoint, since a single authorization fix may not be enough.
Variants to test
- Fallback and error endpoints. Look for paths such as
/api/document/fallback,/api/document/errorand/api/document/retry. A positive result is a fallback returning a shared root or another user's object where the normal path would deny. - Identifier substitution across object types. Change only the object reference (
id,userId,entityId,fileId,documentId,folderId,driveItemId,resourceId,guid) while keeping everything else constant. A positive result is a successful response for an object that unquestionably belongs to another principal. - Read, write and delete tested separately. Do not assume that because GET is protected, POST, PUT, PATCH and DELETE are. A positive result is any one method crossing the ownership boundary while the others are correctly denied.
- Privileged backend identities. Where the application calls Microsoft Graph with a service principal, AWS with an IAM role, or another privileged identity, test whether authorization is enforced before that call. A positive result is an upload session, signed URL or similar grant issued for an object the user does not own.
- Safe write validation. Where write access is suspected and permitted, create a clearly labelled benign object, observe the side effect (for example a child count change), delete it, and confirm the baseline is restored. A positive result is create returning 201 and delete returning 200 with a net-zero footprint.
- Relationship-model testing. Build the graph of user, entity, folder and document for two accounts and test each cross relationship (User A to Document A, User A to Document B, User B to Document A), comparing status code, response size, object identifiers, error messages, metadata and side effects. A positive result is an inconsistency that reveals a missing ownership check without needing a predefined list of vulnerable IDs.
What happened, in plain words
A security researcher built a tool that hunts for bugs automatically, and pointed it at a compliance website used by companies. The website lets each company (called a "vendor") keep its documents in its own folder. The website's screens only ever show you your own company's folder, so at first glance everything looks locked down properly.
The tool asked a different question: when the website's behind-the-scenes machinery receives a request that names a document or folder, does it actually check that the thing being named belongs to you? The answer was no. An account that belonged to no company at all could reach the shared production library where every vendor's documents live, get permission to upload a file into it, and delete a file from it by naming its ID.
The researcher proved this without touching anyone's real documents: they uploaded a harmless test file, saw the library's child count increase, deleted the test file, and saw the count return to its original value. The bug was rated Critical with a CVSS 3.1 score of 9.1.
This article walks through the whole thing from zero. You only need to know how to use a browser.
Some words you will meet immediately
Before the story, a handful of ideas. Each one gets a fuller entry in the glossary at the end.
A server and a client. When you open a website, your computer (the client) asks another computer somewhere else (the server) for pages and data. The server is the one that decides what to send back. Your browser can only ask; it cannot force the server to do anything the server does not agree to do.
An API. Think of a restaurant. The dining room (the website you see) is the client. The kitchen (the server) is where the food is made. The API is the waiter: a fixed list of things you are allowed to ask for, in a fixed format. You say "one of these, please" and the waiter carries the request to the kitchen. You never walk into the kitchen yourself. Websites are built the same way: the page you see asks the API for data, and the API talks to the database or file store.
An endpoint. One specific item on the waiter's menu. GET /api/Entity/GetRootWhenError is one endpoint; POST /api/Entity/CreateUploadSession is another. The first word (GET, POST) is the method: GET asks for a resource, POST sends data for the server to act on.
An object and an object ID. In a document system, an "object" is one thing stored: a file, a folder, a company record. Each one has a long unique name called an ID, so the system can tell them apart. The IDs in this story look like [redacted] or 00000000-0000-0000-0000-000000000000. Think of them like a parcel tracking number: unique, not secret in any meaningful way, and useless on its own unless the system decides to act on it.
Authentication and authorisation. These sound alike and are completely different. Authentication is "who are you?" (you logged in, so we know you are Alice). Authorisation is "what are you allowed to touch?" (Alice may see Alice's company's folder, and nothing else). This whole story is about the second question being asked badly.
BOLA. Broken Object-Level Authorization. It means the system knows who you are, but when you name a specific object, it does not check that the object is yours. If a bank's website lets you view your own statement at /statement?id=1001, and you change it to 1002 and see someone else's statement, that is BOLA. The name is long; the idea is simple: the server trusted the ID you handed it.
A cookie or a session token. After you log in, the server gives your browser a small piece of text to hold on to, like a cloakroom ticket. On every later request your browser shows the ticket, and the server knows it is still you. Without it, the server would treat every request as a stranger. In this story the researcher had a valid ticket: they were a properly logged-in user. The bug was not about getting in; it was about what a logged-in user could reach.
SharePoint and Microsoft Graph. SharePoint is Microsoft's product for storing files and folders for organisations. Microsoft Graph is Microsoft's API for reaching into SharePoint and other Microsoft services. In this story the compliance website stores all vendor documents in one big SharePoint library, and reaches it through Graph.
A service principal. A robot account. Instead of every human user having direct permission to the SharePoint library, the website itself has one powerful robot account, and it does the file work on everyone's behalf. This is very common and not wrong by itself, but it means the website holds a lot of power, and any check it forgets to make is a check nobody else will make either.
CVSS. A standard scoring system for how serious a security bug is. Scores run from 0 to 10. 9.1 is in the "Critical" band.
The application, and what it was supposed to do
The target was a third-party compliance application. Companies use it to manage compliance paperwork. The design is built around "vendor entities": each company is an entity, each entity has a folder, and each folder holds that company's documents.
The intended rule, in the researcher's words, was that a vendor should only be able to access objects belonging to that vendor's entity.
Behind the scenes, all those folders live in one shared SharePoint library, one folder per vendor, and the website's backend reaches it through Microsoft Graph. Picture a filing cabinet in a locked room: every company has its own drawer, but there is one cabinet and one key, and the website holds the key.
The website's visible part (its React client, meaning the part that runs in your browser) behaved correctly. It showed each user only their own company's things, and the requests made through the normal screens looked entirely normal. That is exactly the situation where people conclude "access control works".
The question the hunt turned on was narrower: when the server receives a request naming an object ID, does it independently check that the object belongs to the logged-in user, or does it just trust the ID?
How the hunt was set up
The testing was not done by a person clicking around. It was driven by an autonomous bug-hunting harness: a program that explores an application, maps its API, forms hypotheses about where checks might be missing, and tests them.
The workflow ran through a sequence of stages:
- Application discovery: find out what the application is and what it exposes.
- API extraction: collect the list of endpoints the browser talks to.
- Endpoint classification: sort them into groups, for example the ones that take an object ID.
- Object-ID identification: spot which parameters carry an ID.
- An authorisation hypothesis: guess that the server might not check ownership.
- An authenticated baseline: log in and confirm normal behaviour works.
- Object substitution: swap one ID for another and see what changes.
- Cross-object response comparison: compare the answers.
- Fallback and error-path analysis: look at what happens when things go wrong.
- Safe write validation: prove writing is possible without harming anything.
- Safe delete validation: same for deleting.
- Manual confirmation: a human checks the machine's conclusion.
Two preconditions mattered. First, the researcher used an authenticated account with no assigned vendor entity. Such an account logically has no vendor folder and no vendor documents, so if the server enforced ownership correctly, there would be nothing meaningful in production it could reach. It is the cleanest possible test subject: an account that should see nothing.
Second, the harness needed a way to create and then remove a harmless test file, so that write and delete could be proven without touching real vendor data.
Finding it
The harness identified a set of object-based endpoints under:
/api/Entity/*
Line by line: /api/ is the part of the address that means "this is the application's API". Entity is the group of endpoints dealing with vendor entities. The * is a wildcard meaning "and everything under this group". So this is not one endpoint but a family of them, all sharing that prefix.
Within that family, the harness found operations conceptually equivalent to:
GetEntityInfoAndDDQByIdGetRootWhenErrorCreateUploadSessionDeleteDocumentById
This is four endpoint names run together. Read them as a list: GetEntityInfoAndDDQById (fetch information about an entity by its ID), GetRootWhenError (fetch the root folder when something goes wrong), CreateUploadSession (start an upload), and DeleteDocumentById (delete a document by its ID). The names themselves are a hint about what each does.
Several of these accepted object identifiers supplied by the client, either as a query parameter:
?id=<object-id>
Line by line: the ? marks the start of the query string, the part of a web address that carries extra information. id is the name of the parameter. = separates the name from the value. <object-id> is a placeholder for whatever ID the caller types in. The important word is "client": the value comes from whoever is making the request, which means an attacker can put anything there.
or in a JSON body:
{ "fileId": "<object-id>"}
Line by line: the outer { } are a JSON object, a way of sending structured data. "fileId" is the field name, in quotes because JSON requires it. The colon separates the name from the value. "<object-id>" is the placeholder value, again in quotes because it is text. This is the same idea as the query parameter, just delivered in the body of the request instead of the address.
That pattern alone creates a BOLA hypothesis. The reasoning is: an authenticated user supplies an object ID, and the only question that matters is whether the server checks ownership before acting on it. The filtering in the React UI is irrelevant to that question, because the browser is not a security boundary. Anything the browser does, an attacker can undo before the request leaves their machine.
The first concrete signal came from an error path. A request for an entity that does not exist:
GET /api/Entity/GetEntityInfoAndDDQById?id=00000000-0000-0000-0000-000000000000
Line by line: GET means "fetch something". /api/Entity/GetEntityInfoAndDDQById is the endpoint. ?id= starts the query string and names the parameter. 00000000-0000-0000-0000-000000000000 is the all-zeros ID, a value that is guaranteed not to match any real record. It is the deliberate equivalent of asking for a parcel that does not exist, to see how the system reacts.
That produced an error response, which by itself was unremarkable. Errors happen. But the application had a secondary fallback endpoint:
GET /api/Entity/GetRootWhenError
Line by line: GET again means fetch. The endpoint name says it plainly: get the root when there is an error. It takes no ID at all. It is the application's "if something went wrong, show them this instead" path.
Calling the fallback returned the shared production library root. The response exposed a root object similar to:
id = [redacted]
Line by line: id is the field name in the response. = separates it from the value. [redacted] is the identifier of the root of the shared production library, the top-level folder that contains every vendor's folder. This is the ID of the filing cabinet itself, not of one drawer.
with a child count of approximately:
1494
Line by line: this is a single number from the response, the count of items directly inside that root. Roughly one and a half thousand children means roughly one and a half thousand vendor folders.
That was the first strong indication that the account's effective scope was not limited to its own entity. The application was returning the shared production root to a user with no assigned entity. The fallback path had become an authorisation boundary of its own.
Why does this matter so much? Because the normal path and the fallback path lead to the same underlying resource. Protecting the front door while leaving the fire exit open is not protection. The researcher's point is that developers often harden the happy path and forget that error handling reaches the same data.
Exploitation
Step 1: Confirm the shared root through the fallback
The zero-GUID request to GetEntityInfoAndDDQById fails; calling GetRootWhenError returns the production library root with its ID and a child count of roughly 1494. This establishes that an account with no entity can read shared library metadata.
Why this step: before testing anything destructive, you establish what you can already see. Reading metadata is harmless and tells you the shape of the problem. The account should have seen nothing; it saw the whole cabinet.
Step 2: Supply the shared root as fileId to the upload endpoint
The next question was whether the flaw extended beyond metadata to write operations. Reading is one thing; writing is another, and many applications protect one but not the other. The upload endpoint accepted a client-supplied fileId:
POST /api/Entity/CreateUploadSession
Line by line: POST means "I am sending you data and asking you to act on it". /api/Entity/CreateUploadSession is the endpoint that starts an upload. The name says what it does: create a session, meaning a short-lived arrangement that lets a file be transferred.
with a body conceptually equivalent to:
{ "fileName": "<probe-file>", "fileId": "[redacted]"}
Line by line: the outer { } is the JSON object being sent. "fileName" names the file to be uploaded, with "<probe-file>" as the placeholder for a clearly labelled test name. The comma separates the two fields. "fileId" is the destination, and here the value is not a placeholder but the actual root ID obtained in step 1. The closing } ends the object.
The supplied ID was the shared production root, not an entity owned by the current user. The server responded with an upload session. That was the critical authorisation signal: no ownership validation stood between the client-supplied ID and the grant.
Why this step: the researcher is testing whether the same missing check applies to a more powerful operation. If the server had replied "you do not own that", the bug would have been read-only. It did not.
Step 3: Note what the upload response contains
The upload response contained a pre-authenticated Microsoft Graph/SharePoint upload URL. The application was acting as a privileged intermediary: the authenticated user does not need direct SharePoint permissions, because the application's service principal holds the powerful permissions and calls Graph on the user's behalf. When the application fails to enforce object-level authorisation before that call, the user inherits a capability far broader than intended.
Why this matters: think of a hotel concierge with a master key. Guests cannot open each other's rooms, but the concierge can open any room. If the concierge hands out a key to whoever asks nicely, the guests effectively have the master key too. The website is the concierge. The user never touches SharePoint directly; the website does it for them, with its robot account. So a missing check in the website is not a small gap, it is a gap with the robot's full power behind it.
Step 4: Complete the write with a benign probe
To show the capability was real rather than theoretical, the harness completed the upload using a clearly labelled benign probe file. The server-side result was:
HTTP 201 Created
Line by line: HTTP is the protocol servers use to answer requests. 201 is a status code meaning "created": the server accepted the request and a new thing now exists. Created is the human-readable name for that code. Compare it with 200, which just means "OK, here is your answer".
The production library's child count increased. The sequence was: authenticated account, shared root ID supplied, upload session granted, benign probe uploaded, HTTP 201, library count increased. That is an actual write primitive, meaning a real ability to change data, not just a suspicion that one might exist.
Why a probe file: the researcher could have uploaded something into a real vendor's folder to prove the point. That would have been unnecessary and unsafe. A clearly labelled test file proves the same capability with none of the harm. The count going up is the evidence.
Step 5: Test deletion with the probe's own ID
The delete endpoint accepted a document ID:
POST /api/Entity/DeleteDocumentById?id=<driveItemId>
Line by line: POST again means "act on this". /api/Entity/DeleteDocumentById is the endpoint that deletes a document by its ID. <driveItemId> is a placeholder for the ID of a specific item in the SharePoint drive. A "drive item" is SharePoint's term for a file or folder.
No real vendor document was touched. The harness supplied the ID of the benign probe file it had just created. The API returned:
HTTP 200
Line by line: 200 is the standard "OK" status code. The server accepted the request and carried it out.
The library child count decreased back to its original value. The full sequence was a baseline of childCount = N, creation of the probe giving childCount = N + 1, deletion of the probe returning to childCount = N, a net-zero footprint. This showed the authorisation problem affected write and delete, not only read.
Why this step: read, write and delete are three separate powers, and applications often protect them unequally. Testing each one separately is how you learn the true size of the problem. Deleting the researcher's own probe file also restores the library to exactly how it was, which is the responsible way to finish.
Step 6: Assemble the end-to-end chain
The verified chain was: authenticated user with no assigned vendor entity, fallback endpoint, shared production root exposed, root ID supplied to the upload endpoint, no ownership validation, upload URL granted, benign file created, delete endpoint accepts the object ID, benign file deleted, production state restored.
The server trusted the object ID supplied by the client instead of deriving and enforcing the user's authorised object scope. "Deriving" is the key word: the correct behaviour is for the server to work out from the logged-in user which objects they may touch, and then compare. The wrong behaviour is to take the caller's word for it.
Root cause
The application exposed object references (fileId, driveItem ID, entity GUID) and failed to verify, server-side, that the referenced object belonged to the authenticated user's authorised entity before making the privileged Graph/SharePoint call. A GUID is just a long ID in a standard format, like 00000000-0000-0000-0000-000000000000.
The vulnerable pattern is the classic one:
GET /api/document?id=123
Line by line: GET means fetch. /api/document is an endpoint that returns a document. ?id=123 says which one. This is a made-up example of the general shape, not a real endpoint from this application.
where the backend effectively does:
find(123)return object
Line by line: find(123) means "look up the record with ID 123". return object means "send it back to whoever asked". There is no check in between. The server does exactly what the ID says.
instead of checking ownership first:
object = find(123)
Line by line: look up the record and store it under the name object so it can be examined.
if object.owner != current_user: deny()return object
Line by line: if starts a condition. object.owner is the owner recorded on the object. != means "is not equal to". current_user is whoever is logged in. So the line reads "if the object's owner is not the person asking". deny() means refuse the request. return object sends the object back, but only if the condition above did not trigger. This is the check that was missing.
The intended architecture should have been: authenticated user, determine authorised entity, determine authorised folder, verify the requested object belongs to that folder, then call SharePoint or Graph. Instead the flow was: authenticated user, client supplies object ID, backend trusts the object ID, ownership check missing, privileged service principal, shared production library.
The vendor-level isolation was maintained in the React client, which can determine which folder a user should interact with but cannot enforce anything. The fallback endpoint (GetRootWhenError) exposed the same underlying resource without the checks applied to the normal path, and the privileged service principal meant the backend had the reach to act on whatever ID it was given. The service identity amplified the impact of the missing check.
Impact
The issue was assessed as Critical, with a CVSS 3.1 score of 9.1. An authenticated user with no assigned vendor entity could read shared library metadata, obtain an upload grant for the shared production library, create a file in it, and delete a document by object ID. The flaw was systemic rather than a single isolated endpoint issue, meaning several endpoints shared the same mistake rather than one endpoint having a one-off slip.
If an attacker obtained a valid object identifier belonging to another vendor, the missing check could potentially allow operations against that object: reading vendor compliance information, document tampering or malicious file placement, and destruction of compliance records. The production library contained approximately 1,493 vendor folders, so the failure was potentially systemic rather than isolated to one account, and because the application operated through a privileged backend identity the blast radius could extend across the shared production document store. "Blast radius" means how much damage a single mistake could reach.
Self-registration was not the vulnerability. It mattered only because it established reachability: an internet user registers, gets an authenticated session, and reaches the vulnerable API. The application successfully authenticated the user; it failed to enforce what that user was allowed to access. This distinction is worth holding on to: "anyone can sign up" is normal for many products, and it is not a bug. "Anyone who signs up can reach everyone's data" is.
The write and delete capability was demonstrated only with a benign probe file that was created and immediately deleted. No real vendor document was modified or deleted. The harness deliberately did not read real vendor documents in bulk, modify real vendor records, delete real vendor documents, overwrite vendor compliance files, plant malicious content in vendor folders, or enumerate sensitive vendor data unnecessarily, because none of that was required to establish the authorisation failure. "Enumerate" means listing things out one by one; doing it to someone's private data is itself a harm, even if you only look.
Fix
The primary fix is to enforce authorisation server-side for every object reference. Every endpoint accepting fileId, driveItem ID, entity GUID, folderId or documentId should verify that the object belongs to the authenticated user's authorised entity before making the privileged Graph/SharePoint call. Conceptually:
user_entity = get_authorized_entity(current_user)
Line by line: get_authorized_entity(current_user) asks the system "which entity is this logged-in user allowed to act for?". The answer is stored under the name user_entity. This is the server working out the answer itself, rather than accepting it from the caller.
obj = get_object(object_id)if obj.entity_id != user_entity.id: raise Forbidden()perform_operation(obj)
Line by line: get_object(object_id) looks up the object the caller named and stores it as obj. if obj.entity_id != user_entity.id: asks whether the object's owning entity differs from the user's authorised entity. raise Forbidden() means stop and refuse. perform_operation(obj) carries out the actual work, but only if the check above passed. The order matters: check first, act second.
The exact implementation depends on the data model, but the security property must hold: authenticated user, authorised entity, requested object.
Additional recommendations from the report:
- Protect fallback endpoints. Endpoints such as
GetRootWhenErrorandGetChildrenWhenErrorshould be removed or subjected to the same authorisation checks as their normal equivalents. A fallback that skips the check is just a second front door. - Do not rely on client-side filtering. React and UI logic can improve usability but must never be the authoritative authorisation mechanism. The browser belongs to the user, so anything in it can be changed by the user.
- Minimise service-principal permissions so the backend identity has only the permissions necessary for the operation. If the robot account can only touch what it needs to, a forgotten check does less damage.
- Consider stronger tenant isolation, separating vendor data at the storage or permission boundary instead of placing all vendor documents behind one highly privileged service identity. In plain terms: give each vendor its own locked drawer rather than one cabinet with one master key.
- Audit every object-based endpoint, since a single authorisation fix may not be enough. If the mistake is a habit, fixing one instance does not fix the habit.
Variants to test
These are the general patterns a tester can reuse on other applications.
- Fallback and error endpoints. Look for paths such as
/api/document/fallback,/api/document/errorand/api/document/retry. A positive result is a fallback returning a shared root or another user's object where the normal path would deny. Why: error handling is written in a hurry and tested less than the main path. - Identifier substitution across object types. Change only the object reference (
id,userId,entityId,fileId,documentId,folderId,driveItemId,resourceId,guid) while keeping everything else constant. A positive result is a successful response for an object that unquestionably belongs to another principal. Why: changing one thing at a time is the only way to know what caused the difference. - Read, write and delete tested separately. Do not assume that because GET is protected, POST, PUT, PATCH and DELETE are. A positive result is any one method crossing the ownership boundary while the others are correctly denied. Why: each method is separate code, and separate code has separate mistakes.
- Privileged backend identities. Where the application calls Microsoft Graph with a service principal, AWS with an IAM role, or another privileged identity, test whether authorisation is enforced before that call. A positive result is an upload session, signed URL or similar grant issued for an object the user does not own. Why: the more power the backend holds, the more a missing check is worth.
- Safe write validation. Where write access is suspected and permitted, create a clearly labelled benign object, observe the side effect (for example a child count change), delete it, and confirm the baseline is restored. A positive result is create returning 201 and delete returning 200 with a net-zero footprint. Why: proof without harm is both more ethical and more convincing.
- Relationship-model testing. Build the graph of user, entity, folder and document for two accounts and test each cross relationship (User A to Document A, User A to Document B, User B to Document A), comparing status code, response size, object identifiers, error messages, metadata and side effects. A positive result is an inconsistency that reveals a missing ownership check without needing a predefined list of vulnerable IDs. Why: you are testing the rule, not memorising a list of broken things.
Glossary
- API: the fixed menu of requests a program can make to a server, and the format of the answers. The waiter between your browser and the kitchen.
- Authentication: proving who you are, usually by logging in.
- Authorisation: deciding what a known user is allowed to access or do.
- BOLA (Broken Object-Level Authorization): a bug where the server knows who you are but does not check that the specific object you named belongs to you.
- Benign probe: a harmless, clearly labelled test item created only to prove a capability exists, then removed.
- Blast radius: how far the damage from one mistake can reach.
- Child count: the number of items directly inside a folder. Useful as evidence because it changes visibly when something is added or removed.
- Client: the program on your side, usually your browser. It can ask, but it cannot force.
- Client-side filtering: hiding things in the browser instead of refusing them on the server. It looks like security and is not.
- Cookie / session token: a small piece of text your browser holds after logging in and shows on later requests, so the server recognises you.
- CVSS: a standard 0 to 10 score for the severity of a security bug. 9.1 is Critical.
- Drive item: SharePoint's term for a file or folder stored in a drive.
- Endpoint: one specific address and method on an API, like one item on a menu.
- Enumerate: to list things out one by one. Doing it to private data is itself a harm.
- Fallback endpoint: a secondary path an application uses when the normal one fails. Often less protected than the main path.
- GET / POST: HTTP methods. GET asks for something; POST sends data and asks the server to act on it.
- GUID: a long identifier in a standard format, such as
00000000-0000-0000-0000-000000000000. - Harness: an automated program that drives testing, here one that explores an application and tests hypotheses on its own.
- HTTP status code: the number a server returns to say how a request went. 200 means OK; 201 means created; 403 means forbidden.
- JSON: a common text format for sending structured data, built from names and values in curly braces.
- Metadata: information about something rather than its contents, for example a folder's name, ID and item count.
- Microsoft Graph: Microsoft's API for reaching SharePoint and other Microsoft services.
- Object: one stored thing, such as a file, folder or company record.
- Object ID: the unique name of one stored thing.
- Query string: the part of a web address after the
?, carrying extra values such as?id=123. - React: a popular toolkit for building the part of a website that runs in the browser.
- Reachability: whether an attacker can actually get to the vulnerable part, for example by signing up for an account.
- Root: the top-level folder that contains everything else.
- Self-registration: letting people create their own accounts. Normal, and not a vulnerability by itself.
- Server: the computer that holds the data and decides what to send back.
- Service principal: a robot account used by an application to access another service on users' behalf, usually with broad permissions.
- SharePoint: Microsoft's product for storing an organisation's files and folders.
- Tenant isolation: keeping different organisations' data separated at the storage or permission level, rather than relying on application code alone.
- Vendor entity: in this application, the company record a user belongs to, which owns a folder and its documents.
- Write primitive: a confirmed ability to change data on the server, not merely a suspicion that one might exist.