An attack vector is a path, method, or weakness that an attacker can use to compromise or misuse a system or API. In API security, every exposed input, component, configuration choice, and data flow can create such a path. section 1.1 section 1.4
Treating an API as a gateway into data and functionality makes attack vectors a design and operations concern, not only an implementation problem. Successful exploitation can cause unauthorized access, data leaks, service outages, privacy violations, financial penalties, and reputational damage. section 1.0 section 1.8
Common API attack vectors include:
- URL query and path parameters, request headers, and request payloads that accept unconstrained or malicious input. section 1.4 section 1.8
- Schema configuration and implementation choices that enable data corruption or mass-assignment attacks. section 1.4
- Internal and external service calls, network configuration, dependencies, databases, and other infrastructure components. section 1.1 section 2.2.1
Pagination and avatar-upload examples
A product endpoint such as GET /products?filter=' OR 1=1;-- may turn an unconstrained filter into SQL injection, potentially exposing data or bypassing object-level authorization. A request for 100 million items per page can overload the database and take the site down. Similarly, POST /user/avatar accepting a URL can enable SSRF: an attacker may make internal requests to an admin service, access sensitive data, scan private networks, or leak tokens. section 1.4 section 1.1 section 2.2.1
Figure 1.2 To secure our APIs, first, we identify attack vectors, such as the API input parameters. Then, we model the possible threats. Finally, we harden our API by applying measures that prevent or mitigate those attacks.
Use the attack-vector workflow: identify exposed inputs and components, model possible threats, then harden the API with preventive or mitigating controls. section 1.1
