Hi people,

This story started with a request that looked properly protected. I used one controlled account to reference a private document page owned by my second controlled account, and the server returned 403 Forbidden.

Then I added one page that the first account genuinely owned to the same array.

The server accepted the complete batch.

Publication note: This story is reconstructed from private research. The organization, product, routes, identifiers, dates, document labels, and UI details were removed or replaced. Every example below is synthetic. I am not claiming a deployed fix or completed retest.

One permitted paper page opening a checkpoint for an entire mixed batch, including a foreign page.
Original tactile editorial studio photograph for this anonymized field note.

Two accounts, two markers, one clean boundary

I began with two controlled customer-role accounts: Account A and Account B. Each account created one private document containing a different harmless marker. Account A also created an empty destination document that I could use for copy tests.

Before testing the batch operation, I established the expected controls:

  • Account A could read its own page.
  • Account B could read its own page.
  • Account A could not read Account B's page or document.
  • Account A's destination document was empty.

That last check mattered. If the destination already contained data, a later success response would be difficult to interpret. Starting from an empty controlled object gave me a simple before-and-after comparison.

The foreign-only request was denied

I first sent a copy request containing only Account B's page while authenticated as Account A. The server rejected it. I read Account A's destination again and confirmed that it was still empty.

# Foreign-only negative control
PUT /api/documents/batch-copy
Authorization: Bearer [REDACTED]
Content-Type: application/json

{
  "page_ids": ["page-b"],
  "destination": "archive-a"
}

HTTP/1.1 403 Forbidden

# Same foreign page, now beside one owned page
PUT /api/documents/batch-copy
Authorization: Bearer [REDACTED]
Content-Type: application/json

{
  "page_ids": ["page-a", "page-b"],
  "destination": "archive-a"
}

HTTP/1.1 200 OK
{
  "copied_pages": ["copy-1", "copy-2"]
}

The host, paths, field names, identifiers, and response bodies above are placeholders. They show the authorization pattern rather than reproducing private traffic.

One good ID changed the decision for every ID

The only meaningful difference in the second request was the extra page owned by Account A. The foreign page had not become shared. Account A had not gained a new role. The destination was the same.

Yet the server changed its decision from denied to allowed and copied both pages.

That copy used the owned page first. In separate controlled move and delete runs, I placed the foreign page first; those mixed batches still succeeded. The failure was therefore not confined to one list order, although I did not exercise every route in both orders. Across those actions, the application appeared to ask whether the batch contained any accessible page, then apply that answer to the complete array.

Reconstructed authorization sequence using synthetic accounts and object names, not an original product interface.

A successful response was not the proof

A 200 response can be misleading. The application might ignore one object, create an empty result, or return optimistic metadata before doing any work.

So I read Account A's destination through its normal owner path. It now contained two pages. I downloaded the generated controlled document and extracted both harmless markers: Account A's marker on one page and Account B's marker on the other.

I also compared the copied foreign page with Account B's owner-positive source. The controlled content matched. That ruled out a generic preview, placeholder page, or duplicated Account A content.

The evidence chain was therefore:

  1. Account B created and read its own marked source page.
  2. Account A was denied when that foreign page was requested alone.
  3. The same page was accepted when placed beside Account A's owned page.
  4. Account A read both resulting pages from its own destination.
  5. The copied foreign content matched Account B's controlled source.

I stopped there for the disclosure proof. I did not enumerate unknown identifiers or access third-party documents.

The same mistake affected move and delete

Copying established confidentiality impact, but the document interface exposed other batch actions. I tested those in separate controlled lifecycles so that one mutation could not contaminate the next result.

For move, the foreign-only control was denied and Account B's page remained in its original document. The mixed batch succeeded. Owner readback then showed Account B's page missing from its source and present in Account A's controlled destination.

For delete, the foreign-only control was again denied and the foreign page remained available to its owner. The mixed batch succeeded, and subsequent owner checks showed that both controlled pages had been removed.

Every destructive test used only objects created for the experiment. I removed the remaining run-created objects and invalidated the test sessions afterward.

This changed the observation from an unusual status-code discrepancy into a clear account-boundary failure with controlled read and integrity impact. It did not require claims about unknown users or documents.

The authorization question was existential, not universal

The vulnerable decision can be summarized like this:

// Vulnerable idea
allowed = page_ids.some(page => can_access(user, page))

// Required invariant
allowed = page_ids.every(page => can_access(user, page))

In plain language, the first version asks, "Can this user access at least one page?" A batch operation needs to ask, "Can this user perform this action on every page?"

Random identifiers would not repair that mistake. They may make an object reference harder to discover, but an identifier is still not proof of permission.

Open-source workflow companion: AutoRepeater

A useful open-source companion for this pattern is AutoRepeater. I would use it with two controlled identities to create a small, bounded replacement matrix: owned-only, foreign-only, owned-then-foreign, and foreign-then-owned. That makes it easier to compare status, response shape, and timing without manually rebuilding every request.

I would keep copy, move, and delete requests disabled from broad automatic replay. State-changing checks should run only against explicitly created test objects, one case at a time. Automation can expose the inconsistent decision, but the decisive evidence still comes from owner-side readback and harmless markers. This is a workflow recommendation for authorized testing, not a claim that AutoRepeater was used in the original private submission.

How I would repair and retest it

The server should resolve every submitted object through a query scoped to the authenticated principal, tenant, and requested action. If even one object is unauthorized, missing, or belongs to a different permitted parent than expected, the server should reject the complete operation before performing any side effect.

The mutation should also be atomic. Authorization must finish before copying, moving, or deleting begins, and a failed member must not leave a partially changed batch.

My regression matrix would include:

  • owned-only and foreign-only batches;
  • mixed ownership in both array orders;
  • duplicate, missing, and stale object references;
  • objects from different tenants or parent documents;
  • copy, move, delete, export, and metadata operations; and
  • a permitted shared-user case to prove that valid collaboration still works.

Takeaway

Batch endpoints deserve their own authorization tests. A handler can protect a single foreign object correctly and still fail the moment an authorized object is placed beside it.

The short version is: authorization over an array is an all-elements decision. One good ID must never grant authority over the rest of the batch.

That is all for this write-up. If you want another account-boundary story, read The Export Job That Crossed a Tenant Boundary, compare our API penetration testing approach, or browse the complete Bug Bounty Archive.

Test every object in the array

Batch authorization needs an all-elements decision.

Balhence tests cross-account and cross-tenant access across reads, writes, exports, and multi-object workflows.

Research topics: broken access control / mixed-batch IDOR / cross-account authorization / API security