Story #23 API Security · Object-Level Authorization

The API Checked the User's Role but Not Who Owned the Record

"The user had the right role. They were reading records that belonged to a different company"

Northstar Expense Cloud enforced role-based permissions but not object-level authorization. Authenticated users with manager-level roles could request expense records belonging to other organizations, exposing sensitive financial data across tenant boundaries.

What happened

Northstar Expense Cloud served hundreds of organizations through a shared platform. Expense submissions, manager approvals, and finance reviews all went through the same APIs. Authentication was solid—every request required a valid token. Role-based access control was enforced—employees couldn’t approve their own expenses, managers couldn’t see finance-level reports.

What wasn’t enforced was whether a user could access records from a different organization. The expense record endpoints accepted a record ID in the URL path. The API checked that the requesting user had the manager role. It didn’t check whether the requested record belonged to the requesting user’s organization.

A penetration test discovered that incrementing the record ID in the URL returned expense reports from other companies. No special privileges were needed—just a valid manager-level account with any company.

Sensitive financial data, employee names, amounts, and business justifications from multiple organizations had been accessible to any authenticated manager who guessed or incremented a record ID.

Root cause

Authorization was implemented at the role level but not at the object level. Tests verified that unauthenticated requests were rejected and that lower-privilege roles couldn’t perform restricted actions. No test verified that a valid user from Company A couldn’t access Company B’s records.

The fix

Object-level authorization was added to every record access endpoint. Before returning any record, the API verified that the requesting user’s organization matched the organization recorded on the resource. Automated security tests were added that explicitly attempted cross-tenant access and expected 403 responses.

Lesson learned

Role-based access control and object-level authorization are not the same thing. Every API endpoint that returns a specific record must verify that the authenticated user has access to that specific record—not just that they have a role that could hypothetically access records of that type.

The API Checked the User's Role but Not Who Owned the Record