Building application authorisation regression suites
Building application authorisation regression suites connects a security requirement to the behaviour of a real feature. The relevant controls need to remain effective across custom code, integrations and the production configuration. Understanding application authorisation regression suites helps establish which security property the feature needs and where that property is actually enforced.
What does this involve?
Authorisation determines which resources and operations an established identity may use. It must be enforced where protected data is read or changed. User interface restrictions, obscure identifiers and documentation can help usability, but they do not replace the service's own permission decision.
Authorisation implementation is rarely static. As applications evolve, new API endpoints are added, data layers are refactored, and microservices are decoupled. While initial security testing might validate access controls at launch, the "Day 2" problem emerges quickly: How do engineering teams ensure that new features or structural changes do not break existing authorisation logic?
When building APIs, the authorisation schema should be explicitly defined in the API contract. The OpenAPI Specification provides securitySchemes and security fields to formally declare authorisation requirements at both the global and per-operation level.
Why it matters
Consider a realistic failure: a routine release preserves the successful user journey while breaking a negative access-control case.
A missing check can expose another account's information or let an ordinary user perform a privileged action. The result should be described by the actual records and operations reached, including whether access crosses a customer or organisational boundary.
Implementation guidance should be applied to a real feature and its deployment. Framework defaults, custom handlers and integrated services all influence whether the intended protection remains effective.
How penetration testers check for it
Trace the relevant feature from its entry point to the data or operation it protects, including custom code and alternate paths.
- Compare users with different roles and ownership relationships.
- Exercise read, change, delete and alternate access paths.
- Test nested resources, background processing and state changes.
- Confirm rejection as well as the legitimate successful journey.
How to fix it
Use the appropriate maintained mechanisms and verify the result in the actual production configuration.
- Assertion: The system must return a 403 Forbidden or 404 Not Found (to avoid information leakage about resource existence), never a 200 OK.
- Assertion: Ensure the endpoints explicitly reject the requests. Relying on UI hiding is insufficient; the API layer must enforce the check — client-side controls are trivially bypassed.
- Implementation: Provision two distinct tenants (Tenant Alpha and Tenant Beta) in the test environment. Seed data into Tenant Alpha. Execute broad read queries (e.g., GET /api/all-records) as a user from Tenant Beta.
- Assertion: Assert that the response payload contains absolutely no records belonging to Tenant Alpha. Even a single leaked record identifier constitutes a critical failure.
- Enforce permission checks at each protected operation.
- Maintain regression cases for unauthorised users and changed permissions.
A successful response alone does not prove unauthorised access. Establish whose resource was affected and what the caller was legitimately entitled to do.
Recheck the changed behaviour against the original failure conditions and the legitimate user journey. Keep enough evidence to show which release and configuration were verified, and include related entry points that depend on the same security decision.
Related issues
- Building repeatable API authorisation regression tests
- Distributing authorisation policy and decision data safely
- Choosing an authorisation model that fits the application
Read about our methodology or contact pentested.com to discuss secure development and code review.