Secretariat: ten API risks, step by step
A defensive lab for the OWASP API Security Top 10, written in C#.
Secretariat is the records API of a made-up university. It carries one deliberate mistake for each risk of the OWASP API Security Top 10, 2023 edition, and a repaired version of each.
For each risk, the guide will show the mistake in code, the scenario that proves it, the fix in ASP.NET Core and the rule that sees it in traffic.
The project is in progress. The list of risks and the verified resources are published now. The guide's chapters and the guided demonstration appear as they are finished.
The ten risks
The names are the official ones, from the OWASP API Security Top 10. Under each stands one sentence on what it means.
-
API1:2023
Broken Object Level Authorization
The server returns an object by its identifier without checking that the caller may see it.
-
API2:2023
Broken Authentication
The authentication mechanism can be bypassed or brute-forced, so an attacker passes as another user.
-
API3:2023
Broken Object Property Level Authorization
The API shows, or accepts changes to, fields of an object that the user should not reach.
-
API4:2023
Unrestricted Resource Consumption
Requests have no limit on size, count or time, so a single client can exhaust the service or run up its costs.
-
API5:2023
Broken Function Level Authorization
A regular user can call functions reserved for another role, such as the administrative ones.
-
API6:2023
Unrestricted Access to Sensitive Business Flows
A valuable flow, such as a booking, can be used automatically and in excess, with no technical bug in the code.
-
API7:2023
Server Side Request Forgery
The server fetches a resource from an address the client supplies, without checking it, and can be pointed at internal services.
-
API8:2023
Security Misconfiguration
Settings left at their defaults, too permissive or incomplete: detailed error messages, wide-open CORS, forgotten debug routes.
-
API9:2023
Improper Inventory Management
Old versions and undocumented routes stay deployed and no longer get the protections the rest has.
-
API10:2023
Unsafe Consumption of APIs
The application takes the responses of an external API at their word and uses them without validation.
How the lab is kept
The lab works on synthetic data only. Once published, it will run on a network with no route to the Internet, and the site will send it fixed scenarios only. The lab API will not answer directly from outside.