Read a sample: 1. The Authorization Tester's Mission
A user signs in to a project-management service and opens a task assigned to a colleague. The application displays the task’s title, status, and comments. Is that normal collaboration, or an authorization failure?
The answer depends on rules the request alone cannot reveal. Perhaps both users belong to the same project, and every project member may read its tasks. Perhaps the task belongs to a different customer organization and should never have been visible. Before calling the result a vulnerability, a tester needs to know who the user is, which object was requested, what action was attempted, and which boundary the service was expected to enforce.
That is the central mission of API authorization testing: determine whether the service enforces its intended access rules when a request reaches the server. The work is not simply finding a request that produces data. It is building a justified comparison between what an actor was allowed to do and what the system actually permitted.
This chapter introduces that way of thinking. It also establishes a principle that governs every technique in this book: a technically interesting request is not automatically an authorized test. Permission, scope, and responsible handling of results are part of the method, not administrative details to settle afterward.
Throughout this chapter, imagine an API-backed service called TaskHarbor. Organizations use it to manage projects and tasks. Its web interface sends requests to an API, which checks the request and returns information or performs an operation.
For our initial examples, the service owner describes these rules:
- Each organization has its own projects and tasks.
- A project member may read tasks in projects they belong to.
- A task assignee may update the status of an assigned task.
- An organization administrator may invite members to that organization.
- Membership in one organization does not, by itself, grant access to another organization’s data.
These are fictional business rules, not universal rules for project software. A real service might allow all organization members to view every task, give project managers broader update rights, or support sharing across organizations. The tester’s job is to establish the applicable rule rather than substitute a personal expectation.
Suppose Maya is a member of Cedar Studio and is assigned a task called “Prepare launch checklist.” Another test user, Leon, belongs to Cedar Studio but is not a member of Maya’s project. A third user, Priya, is an administrator at a separate organization, Harbor Works.
If Leon can read Maya’s task, the result may conflict with the stated project-membership rule. If Priya can invite a member to Cedar Studio, the result may cross an organization boundary, even though Priya is an administrator somewhere else. In both cases, the important question is not merely whether the user is signed in or holds a recognizable role. It is whether that particular user may perform that particular action on that particular target.
Authentication establishes the identity associated with a request. A service might authenticate a user through a session established at sign-in or through a token presented with an API request. The details vary, but the practical question is: “Who is making this request?”
Authorization determines what that authenticated identity is allowed to do. Its practical question is: “May this user perform this action on this target under these circumstances?”
A successful sign-in answers the first question, not the second. Maya’s valid session should let TaskHarbor recognize her, but it should not automatically give her access to every task in the service. Similarly, Priya’s administrator role at Harbor Works should not automatically make her an administrator at Cedar Studio.
Some services also allow actions without a signed-in user. A public project page, for example, could be intentionally readable by anyone. In that case, authorization still matters: the policy may permit an anonymous read while restricting updates. Being denied access is not always the only correct outcome, just as receiving data is not always evidence of a flaw.
Authorization is often contextual. A decision may depend on the user’s role, project membership, ownership of a record, the record’s state, or the organization to which it belongs. A user who can update an open task might not be allowed to reopen a completed one. A user who can read a project might not be allowed to invite people to it.
For a tester, “the user has an account” is therefore too broad a baseline. Record the relevant identity and its relationship to the target: which organization, which project, which role, and which assignment. Those relationships are what make an outcome meaningful.
An object is a thing the service manages or exposes. In TaskHarbor, an organization, project, task, invitation, and comment can all be objects. An object may have an identifier that lets the API distinguish it from other objects of the same type.
An action is what a caller asks the service to do with an object. Common actions include reading a task, changing its status, adding a comment, inviting a member, or removing a project. Some actions are not simple edits to a record: approving an invitation or transferring ownership can change a relationship or advance a workflow.
This distinction helps turn a vague question—“Can Leon use the API?”—into testable questions:
- Can Leon read a task in a project he belongs to? - Can Leon read a task in a project he does not belong to? - Can Leon update the…