When a Valid API Request Becomes Unauthorized
A customer calls a billing department after opening an invoice that belongs to someone else. The customer did not guess a password, break into the account, or use an administrator screen. They were signed in to their own account and followed a link from a routine notification. The application accepted the request and returned another person's invoice.
That is the troubling part. Nothing in the first report suggests the sign-in system failed. The application seems to have recognized a real customer and still delivered a record the customer should not have received. We need to understand the security decisions an application makes after someone is authenticated, and why those decisions can fail in a system built around application programming interfaces, usually called APIs.
An API is a way for one piece of software to request a service from another. A mobile app might ask for an invoice, a web page might request a list of orders, or a background application might submit a payment. Often the request travels through several components before a result returns. The user sees a familiar page, but the security decision may be made by a service the user never sees.
Picture a restaurant where a customer gives a claim number to a clerk. Checking the customer's name against a reservation establishes one fact. It does not establish that every numbered package behind the counter belongs to that customer. The clerk must compare the claim with the specific package. An API that accepts any invoice number after checking that the caller is signed in has made a similar mistake. The sign-in can be entirely correct while the resource-level access decision is wrong.
The Bare Metal Cyber Cyber Challenge provides optional practice for making this distinction after listening. Take a scenario where a signed-in user receives an unexpected record, and explain which evidence would confirm the caller's identity and which would show whether access to that specific record was authorized. Those are separate facts, even when an application presents them as one successful transaction.
In a typical web-based API call, software identifies a destination and a resource, states what it wants to do, and supplies information the server needs to handle the request. That information might include a session credential or a token representing the caller. Some requests retrieve information; others submit or change it. The analyst's work is to reconstruct the intention, the identity the service accepted, the permission that should have applied, and the actual outcome. There is no need to recite the exact path or request syntax to reason through this case.
We need a reliable description of what the customer actually did. The customer may have followed an incorrect link generated by the billing application. A cached page might have displayed another user's information. Or the service might have accepted a request for an invoice owned by someone else. Those failures require different evidence and different corrections. The initial report gives us a symptom, not its cause.
Suppose the application team finds that the browser asked an invoice service for a record identified by a number. The gateway accepted the request because it carried a valid login token. The billing service retrieved the requested invoice and returned its contents. The problem lies at the point where the billing service should have checked whether the customer represented by that token could view the specified invoice. The number identifies a record. It does not authorize access to it.
This is the general idea behind broken object-level authorization. An object might be an invoice, a ticket, a customer profile, or a document. The requester supplies or indirectly selects an identifier, and the server must enforce the relationship between the requester and that object. The shape of the identifier does not solve the problem. Making numbers long or difficult to guess can reduce casual discovery, but the server still needs to reject a request for a record outside the caller's permitted scope.
There is a second variation worth hearing carefully. The customer may be permitted to see an invoice, but the response might contain a bank-account detail or internal fraud note that should be available only to billing staff. Here the object itself is authorized, but some properties in its response are not. The server must apply the relevant permissions to what it returns as well as to which record it returns. Hiding a field in a mobile app does not protect the information if the underlying API still sends it.
The difference between authentication and authorization also changes how we interpret tokens. A token is a piece of authentication or authorization material that an application can use to recognize a caller or understand their granted scope. Some tokens carry signed information; others are reference values checked by the server. A signature can protect the integrity of token claims, provided they are validated correctly. It cannot guarantee that every requested business action is permissible. A valid token remains subject to the application's access rules.
Now suppose an attacker steals the customer's token. The billing service sees requests authenticated as that customer, even though the customer did not send them. That's a different failure mode. Evidence about token issuance, device context, recent session activity, and other requests can reveal suspected theft. Revoking the token may remove the attacker's access. But if the application also has broken object-level authorization, revocation alone will not fix the underlying weakness. A new legitimate customer may be able to repeat the same unauthorized request.
Let's return to the original caller. The invoice came from a link in an ordinary email. A developer says the service was designed so that customers can only navigate to invoices linked to their accounts. That describes how the user interface is intended to behave. It does not establish what the server enforces. Clients can make requests outside the normal interface flow, links can be shared, and automated clients can call the same API. Authorization must be checked by the trusted server each time the protected action is requested.
There is a related issue when the client is another service rather than a human. An internal reporting application might have a token that can read invoices for an entire region. That broad permission may be necessary for a specific job, or it may reflect a shortcut that was never revisited. If the reporting application is compromised, the attacker's effective access follows the reporting identity's permissions. Calling the API from an internal network does not turn a broad permission into a safe one.
We can tell a great deal from logs, but the log source must be matched to the question. A network gateway may record the route, time, source, caller information where available, and response status. The application may record the user identity it accepted, the invoice requested, and the access-control outcome. The database may show which record was read, depending on its auditing configuration. Each source sees a different part of the operation. A gateway success does not prove the business authorization was correct. A database read does not necessarily prove what was returned to the caller.
These distinctions create an important logging challenge. A well-designed audit record can tell investigators which principal requested an object and whether access was granted without copying the full invoice into a security log. Recording complete credentials, payment details, or unneeded personal data could make the logs themselves a target. Useful evidence should establish the decision and outcome while respecting data-protection needs.
At this point, the independent Bare Metal Cyber study guide for this certification can help with optional follow-up reading on APIs, tokens, and access control. A productive review question is whether a given record establishes authentication, authorization, or actual data exposure. Real investigations become much clearer when those categories are not treated as interchangeable.
Suppose the billing service returns a successful response, but the customer says the invoice did not appear on the page. Perhaps the browser discarded the result after detecting a mismatch. That could mean the data reached the client but was not rendered. Perhaps a backend service returned an error payload that the gateway recorded as a success. We should not force every layer's status into one conclusion. If the question is whether unauthorized information left the service, we need evidence of the response content or a trustworthy application record, not merely the fact that the gateway answered the request.
The same caution applies when a response indicates failure. Some systems acknowledge a request before finishing the work. A service could return a status that looks unsuccessful while a downstream transaction later commits. Others intentionally obscure whether an object exists. An analyst investigating data changes must look beyond a single status code and determine whether the requested operation had an effect.
The next challenge is scope. One customer saw one misplaced invoice. Was the problem limited to a stale link, or can any customer request any invoice? Did the mistake affect only a new application version? Is a similar authorization check shared with customer profiles and support documents? Security teams need a controlled assessment by the people authorized to test the application, along with a review of relevant access records. They should not assume that one demonstrated exposure reveals the full population, or that an absence of alarms proves there were no other exposures.
An access-control flaw can also combine with excessive automation. An attacker might request many different invoice identifiers quickly. Rate limits can constrain how aggressively this happens and can produce useful signals. They do not repair broken authorization. A determined caller might make requests slowly, or distribute them across sessions. The server must make the correct decision even when there is only one request.
There are other risks in API handling that analysts should recognize without memorizing syntax. A service might accept a well-formed amount for a transfer but fail to confirm that the caller owns the account being debited. An update request might allow a customer to change an internal approval field that should be controlled by staff. A feature that accepts external input may pass that input unsafely to a database or another service. In each case, the format can be valid while the business rule or safe-processing boundary is violated.
You can distinguish those failures by the question the missing control should have answered. Object authorization asks whether this caller can access this particular record. Property authorization asks which parts of the record the caller may read or change. Function authorization asks whether the caller may use the operation at all, such as approving a refund. Input handling asks whether supplied data can safely be processed. Those protections often work together, and the analyst should avoid assuming that improving one repairs the others.
Consider another billing incident. A support employee with a legitimate internal account generates hundreds of refunds through an API normally used by a supervisor. The employee was correctly authenticated and the refund requests had valid amounts. If the function was supposed to require supervisory permission, the likely failure is function-level authorization. If the employee had valid supervisory authority but submitted refunds for accounts outside their assigned region, record-level or business-rule enforcement may be the issue. If a stolen token performed the actions, identity compromise also enters the investigation. The same symptom can have different causes.
A service distributed across multiple systems adds one more complication: a single customer action may generate several technical events. A gateway records an incoming request. An application makes another request to the invoice service. That service may query a database and trigger a separate audit record. Correlation identifiers, where available, help connect those events. But investigators must verify that identifiers refer to the same transaction and that clocks and retention periods are compatible. Otherwise, they can mistake unrelated operations for one causal chain.
This concern carries over into incident containment. If the customer can access another customer's invoice, disabling the vulnerable endpoint may stop further exposure, but it might also prevent legitimate customers from retrieving their bills. A targeted authorization rule, a temporary restriction on the affected feature, or an approved application rollback may be more proportionate. The business owner and incident authority should weigh the continuing exposure against the service impact. Whatever action is chosen, the team must verify that unauthorized requests are now rejected and authorized customers still receive their own records.
If token theft is also suspected, changing application code will not remove a stolen session. If an internal machine identity is too powerful, securing a customer-facing endpoint may leave the back-office route open. If cached records remain accessible in a shared service, the fix may need to address that layer too. The response follows the actual failure, not the name of the tool where the first alert appeared.
An application team might report that the fix is complete because a new version has been deployed. That only tells us the change was delivered. Evidence of successful remediation comes from tests under relevant identities, review of adjacent functions, and monitoring for continued attempts or unexpected access. The team also needs to know which historical events can support an assessment of possible exposure. If logging was incomplete, the incident report should say so plainly rather than invent a precise count of affected records.
Think again about our first customer, who opened someone else's invoice through an ordinary link. The key lesson is not that APIs are mysterious or unusually unsafe. They are places where software makes consequential decisions on behalf of people and other systems. A successful login establishes one part of the story. A valid request format establishes another. Neither replaces the server's duty to decide whether the caller may perform that action on that resource and receive that result.
When you hear about a suspicious API transaction, follow it from the caller's identity to the object requested and the business decision that was enforced. Then ask what the application actually returned or changed, which records support that outcome, and whether the same weakness could affect other routes. That reasoning works whether the request came from a browser, a mobile app, or a background service.