appsec.fyi

API Security — A Practical Guide

A curated AppSec resource library covering XSS, SQLi, SSRF, IDOR, RCE, XXE, OSINT, and more.

API Security: A Practical Guide

Curated and synthesized by . Last updated 2026-08-16. Synthesized from 296 of 296 curated resources. Browse all 296 API Security resources →

The Evolving Threat Landscape: API Security in Practice

The proliferation of APIs has fundamentally altered how applications interact and share data. While this has unlocked unprecedented levels of interoperability and innovation, it has also expanded the attack surface for malicious actors. Modern applications increasingly rely on APIs for core functionality, making their security paramount. Understanding the evolving threat landscape and adopting robust security practices is no longer optional; it's a necessity for protecting sensitive data and maintaining service integrity.

The Ubiquitous API and Its Perils

APIs serve as the connective tissue for microservices, mobile applications, third-party integrations, and increasingly, AI-driven systems. This widespread adoption, however, has led to a significant increase in API-related vulnerabilities and attacks. Reports indicate that a substantial portion of security vulnerabilities in recent years have been API-related [1][2]. This trend is further exacerbated by the speed at which new APIs are deployed and the inherent complexity of modern distributed systems.

One significant challenge is the rapid growth of "shadow" or "rogue" APIs – endpoints that are not properly documented, managed, or secured [3]. These often arise from development teams deploying new services without adequate oversight. Furthermore, the rise of AI-assisted development, while boosting productivity, has also introduced new risks. Studies show that a significant percentage of AI-generated code contains security flaws [4], and these flaws can manifest as API vulnerabilities, including exposed API keys and insecure configurations [5][6]. The ease with which AI coding assistants can inadvertently leak sensitive data, such as API keys or database credentials, is a growing concern [7][8].

Core Mechanics of API Attacks

Many API attacks exploit fundamental security weaknesses that mirror those found in traditional web applications, but with nuances specific to API communication. These often fall into categories defined by frameworks like the OWASP API Security Top 10 [9].

Broken Object Level Authorization (BOLA) and IDOR

BOLA, often manifesting as Insecure Direct Object References (IDOR), is consistently identified as the top API security risk [10][11]. This occurs when an API allows a user to access, modify, or delete objects they are not authorized to interact with. Attackers achieve this by manipulating object identifiers in requests. For instance, an attacker might change a user ID or an order ID in a URL or request payload to access data belonging to another user [12][13]. This vulnerability is particularly prevalent in APIs that expose sensitive business logic and data, such as financial or personal information. The risk is amplified as 40% of all API attacks are BOLA-related [2].

Broken Function Level Authorization (BFLA)

BFLA allows users to access functionality or perform actions that are outside of their intended permissions. This could involve a standard user accessing administrative functions or performing privileged operations. Unlike BOLA, which targets specific data objects, BFLA targets the actions an authenticated user can perform. Automated scanners often miss these flaws, making them prime targets for manual penetration testers [14].

Mass Assignment (Autobinding)

Mass assignment vulnerabilities arise when an API automatically binds incoming request parameters to an object model without explicitly defining which parameters are allowed. An attacker can exploit this by including unexpected or privileged fields in their request payload, which are then processed by the API, leading to unintended consequences like privilege escalation or data manipulation [15][16].

Security Misconfiguration

This broad category encompasses a wide range of issues, from default credentials on management interfaces to verbose error messages that reveal sensitive system information [3][17]. Improper API inventory management, leading to outdated or debug endpoints remaining exposed, also falls under this umbrella [18][19]. Misconfigurations in API Gateways are a common entry point, including exposed administrative APIs, missing firewall rules, and insecure storage of secrets [20].

Server-Side Request Forgery (SSRF)

SSRF vulnerabilities allow an attacker to trick a server-side application into making HTTP requests to an arbitrary domain of the attacker's choosing. This can be used to access internal resources, scan internal networks, or interact with cloud provider metadata endpoints, such as the EC2 instance metadata service [21].

Credential Exposure and Improper Asset Management

Hardcoded API keys and secrets within client-side code or exposed in API responses are a critical risk [22]. This is compounded by a lack of visibility into the API landscape, leading to the existence of undocumented or "shadow" APIs, as well as the continued use of deprecated and vulnerable API versions [3]. The increase in AI-assisted development has led to a concerning rate of secret leaks in AI-generated code [5][8].

Notable Techniques and Attack Vectors

Beyond the core OWASP API Security Top 10, several specific techniques and attack vectors are frequently encountered in API security testing.

HTTP Request Smuggling

HTTP request smuggling remains a potent attack vector, allowing attackers to prepend or append malicious requests to those of legitimate users. Variations like CL.TE and TE.CL are well-established, but HTTP/2 specific smuggling vulnerabilities (H2.CL, H2.TE) have emerged, particularly concerning due to the complexity of HTTP/2 parsing and potential for desynchronization between front-end and back-end servers [23][24][25][26]. These vulnerabilities can be amplified at API gateways and are used to bypass security controls, poison caches, and compromise user sessions. For instance, H2.CL exploits inconsistencies where the HTTP/2 connection downgrades to HTTP/1.1 and the Content-Length header is mishandled [26].

GraphQL Security Threats

GraphQL, with its flexible query language, introduces unique security challenges. Introspection abuse allows attackers to discover the entire schema, revealing potentially sensitive data fields and operations [27][28]. Query depth and complexity attacks, including cyclic queries and batching attacks, can be used to exhaust server resources, leading to Denial-of-Service (DoS) [28][29]. Field-level authorization challenges and argument manipulation are common BOLA vectors within GraphQL APIs [27][13].

OAuth 2.0 Vulnerabilities

While OAuth 2.0 is a standard for delegated authorization, its implementation can introduce significant vulnerabilities. Broken OAuth flows can lead to account takeover, token leakage, and unauthorized access [30][31][32]. Issues can arise from insecure redirect URIs, improper handling of refresh tokens, or vulnerabilities in specific flows like the implicit flow. Major AI clients have been observed shipping with broken OAuth implementations [33]. Token binding with TLS is a promising enhancement to cryptographically link tokens to their originating TLS connection, mitigating certain token-based attacks [34].

Web Cache Poisoning and Deception

These attacks manipulate caches to serve malicious content to legitimate users. Web Cache Poisoning involves injecting input that causes the cache to store an incorrect response, while Web Cache Deception leverages the cache's behavior with different request headers to serve unauthorized content [35]. In API contexts, this can lead to users receiving incorrect data or being redirected to malicious endpoints.

Cross-Origin Messaging (postMessage)

Vulnerabilities in the use of window.postMessage can lead to DOM XSS or information leaks. This occurs when web pages send messages to each other without proper validation of the origin or content of the message [36].

AI-Assisted Attacks and Vulnerabilities

The integration of AI into development and security tooling is a double-edged sword. While AI can enhance vulnerability detection [37], AI-generated code is proving to be a significant source of vulnerabilities, including those related to APIs [4][5]. Attackers are also leveraging AI to automate API attacks, making exploitation faster and more sophisticated. Findings suggest that AI-assisted commits leak secrets at a higher rate than traditional commits [8]. Furthermore, security flaws in AI platforms themselves, such as those found in Claude Code and Gemini CLI, have led to sensitive data leaks and code execution on CI runners [38].

Detection and Prevention Strategies

A multi-layered approach is essential for effective API security, combining automated tooling with robust manual testing and secure development practices.

API Discovery and Inventory

The first step in securing APIs is knowing what you have. Comprehensive API discovery and inventory management are critical to identify all exposed endpoints, including shadow APIs [3][39]. Tools like Akto, Noname, and APIDetector can aid in this process by scanning for exposed documentation and endpoints [3][40].

Static and Dynamic Analysis

Static Application Security Testing (SAST) tools can identify vulnerabilities in code before deployment, while Dynamic Application Security Testing (DAST) tools, including specialized API scanners like Invicti, Burp Suite DAST, and Checkmarx DAST, can test running applications for known vulnerabilities [37]. For APIs, DAST tools often leverage OpenAPI specifications to generate test cases [41]. AI-powered DAST solutions are also emerging [37].

Automated API Fuzzing

Fuzzing is an effective technique for discovering vulnerabilities by providing malformed or unexpected data to API endpoints. State-of-the-art fuzzers, such as RESTler and openapi-fuzzer, are designed to work with API specifications to generate targeted test cases [42][43][44]. Tools like firefly offer advanced features for payload tampering and request verification, while ffuf provides command-line fuzzing capabilities [45][46]. WebSocket Turbo Intruder is specifically designed for fuzzing WebSocket messages, useful for uncovering race conditions [47].

Penetration Testing and Manual Review

Despite advancements in automation, manual penetration testing remains crucial, especially for identifying complex business logic flaws, authorization bypasses (BOLA/BFLA), and vulnerabilities that automated scanners might miss [14][13][48]. Tools like Burp Suite are indispensable for intercepting and manipulating API requests during manual testing [49][50].

Secure Development Practices (Shift-Left)

Integrating security early in the development lifecycle is paramount. This includes:

Web Application Firewalls (WAFs) and API Gateways

WAFs can provide a layer of defense against common web attacks, but they are not a panacea, especially against API-specific threats like BOLA or complex smuggling attacks [3][24]. API Gateways, such as Kong or AWS API Gateway, offer centralized control for authentication, authorization, rate limiting, and request transformation, but their own configurations must be secured [53][3][18][20].

Runtime Protection

Runtime protection solutions, like those offered by Salt Security, use big data analysis to detect and respond to threats in real-time, identifying anomalous API behavior [3]. Virtual patching can offer immediate protection against newly discovered vulnerabilities while permanent fixes are developed [37].

Tooling and Resources

A rich ecosystem of tools exists to support API security efforts:

Recent Developments and Future Trends

The API security landscape is continuously evolving. The increasing sophistication of AI in both attack and defense is a significant trend [55][4]. Attackers are leveraging AI for faster vulnerability discovery and exploitation, while defenders are using AI for more intelligent detection and remediation.

The focus is shifting towards continuous API discovery and assessment of exploitability, moving beyond simple vulnerability scanning to understanding critical attack paths [39]. The rise of AI coding assistants and "vibe coding" platforms presents systemic risks that require new approaches to code review and security testing [5][6]. The emergence of new HTTP/2 specific vulnerabilities and advanced request smuggling techniques continue to challenge network defenses [25][26].

Where to Go Deeper

For practitioners seeking to deepen their understanding of API security, the following resources are invaluable:

Sources cited in this guide

  1. Canton Enterprise Integrations: APIs Connectors and Risk Boundaries — halborn.com
  2. Inside Modern API Attacks: 2026 API ThreatStats Report - Wallarm — lab.wallarm.com
  3. API Security Testing: Tools and Techniques - API7.ai — api7.ai
  4. Secure AI-Generated Code at Speed with Snyk and ServiceNow — snyk.io
  5. Lovable left thousands of projects exposed for 48 days and the vibe coding security crisis is only getting worse — thenextweb.com
  6. Wiz Research Discovers One in Five Organizations Exposed to Systemic Risks in Vibe-Coded Applications - Here's How to Secure Them — wiz.io
  7. Security Researcher: WordPress 7.0 Could Trigger Rush To Steal AI API Keys — searchenginejournal.com
  8. State of Secrets: 28 Million Credentials Leaked on GitHub in 2025 — snyk.io
  9. OWASP API Security Project | OWASP Foundation — owasp.org
  10. What Is Broken Object Level Authorization? — paloaltonetworks.com
  11. API1:2023 Broken Object Level Authorization — lab.wallarm.com
  12. Broken Object-Level Authorization (BOLA): What It Is and How to Prevent It — invicti.com
  13. Securing the Gates: Mastering BOLA and BFLA in API Security — kayssel.com
  14. BOLA and BFLA: The API Vulnerabilities That Silently Expose Data — lorikeetsecurity.com
  15. This Is How I Hacked an API Using Mass Assignment Vulnerability — spyboy.blog
  16. What is Mass Assignment? Attacks and Security Tips — vaadata.com
  17. From Unauthenticated API to Grid Risk: A Hybrid Inverter Vulnerability Explained — saiflow.com
  18. API Gateway Authorizers: Vulnerable By Design — authress.io
  19. API Security 101: Security Misconfiguration — medium.com
  20. Kong API Gateway Misconfigurations: A Security Case Study — trendmicro.com
  21. Detect SSRF Attacks in Cloud Applications and APIs | Datadog — datadoghq.com
  22. PayloadsAllTheThings: API Key Leaks — github.com
  23. CRLF-Powered Desync Attacks: Beheading HTTP Streams — portswigger.net
  24. HTTP Request Smuggling in API Gateways — apisec.ai
  25. Advanced request smuggling — portswigger.net
  26. HTTP/2: The Sequel is Always Worse — portswigger.net
  27. Awesome GraphQL Security - Curated List of Resources — github.com
  28. Damn Vulnerable GraphQL Application — github.com
  29. Exploiting GraphQL — blog.assetnote.io
  30. Unlocking OAuth Security — infosecwriteups.com
  31. What is OAuth (The Modern Guide) — fusionauth.io
  32. OAuth 2.0: Security Considerations — github.com
  33. Major AI Clients Shipping With Broken OAuth Implementations (JUNE 2026 UPDATE) — redcaller.com
  34. OAuth 2.0 Token Binding — medium.com
  35. Hackmanit/Web-Cache-Vulnerability-Scanner: Web Cache Vulnerability Scanner is a Go-based CLI tool for testing for web cache poisoning. It is developed by Hackmanit GmbH (http://hackmanit.de/). — github.com
  36. DetectCrossOriginMessaging — github.com
  37. Top enterprise DAST tools in 2026 — aikido.dev
  38. Claude Code and Gemini CLI Flaws Let a GitHub Issue Reach CI Workflow Secrets — thehackernews.com
  39. Eliminate Critical API Attack Paths with Wiz API SPM — wiz.io
  40. APIDetector: Scan for Exposed Swagger Endpoints — github.com
  41. wapiti-scanner/wapiti: Web vulnerability scanner written in Python3 — github.com
  42. Stateful REST API Fuzzing with RESTler — code-intelligence.com
  43. openapi-fuzzer: Black-box Fuzzer for OpenAPI Specifications — github.com
  44. RESTler: Stateful REST API Fuzzing Tool — github.com
  45. GitHub - Brum3ns/firefly: Black box fuzzer for web applications — github.com
  46. ffuf advanced tricks - ACCEIS — acceis.fr
  47. WebSocket Turbo Intruder: Unearthing the WebSocket Goldmine — portswigger.net
  48. How To Prepare For An API Penetration Test — blazeinfosec.com
  49. PortSwigger Lab: Exploiting a Mass Assignment Vulnerability — portswigger.net
  50. API Testing with Burp Suite: A Practical Guide — pynt.io
  51. GitHub - chaitin/SafeLine: SafeLine is a self-hosted WAF(Web Application Firewall) / reverse proxy to protect your web apps from attacks and exploits. — github.com
  52. Practical HTTP Header Smuggling: Sneaking Past Reverse Proxies to Attack AWS and Beyond — intruder.io
  53. Kong API Gateway Misconfigurations Case Study - Trend Micro — trendmicro.com
  54. VAmPI: Vulnerable REST API with OWASP Top 10 Vulnerabilities — github.com
  55. Google Bug Hunter Claims $500K From AI-Assisted Vulnerability Pipeline — techrepublic.com
  56. ServiceNow API Security Incident Exposes Customer Data: Analysis of Unauthenticated Access Vulnerability (June 2026) — rescana.com
  57. Critical Azure Cosmos DB flaw threatened cross-tenant database takeover — csoonline.com
  58. IngressNightmare: CVE-2025-1974 - 9.8 Critical Unauthenticated Remote Code Execution Vulnerabilities in Ingress NGINX — wiz.io
📚 This guide is synthesized from the full text of resources curated in the API Security library, and refreshed as new material is added.