A foundational element of innovation in today’s app-driven world is the Application Programming Interface (API). From banks, retail, and transportation to IoT, autonomous vehicles, and smart cities, APIs are a critical part of modern mobile, SaaS, and web applications and can be found in customer-facing, partner-facing, and internal applications. By nature, APIs expose application logic and sensitive data such as Personally Identifiable Information (PII) and because of this, APIs have increasingly become a target for attackers. API security therefore focuses on strategies and solutions to understand and mitigate the unique vulnerabilities and security risks associated with APIs.

The Cyber Threat imposed by APIs

Facebook’s recent 2018 data breach was left open for more than 20 months, resulting in the theft of 30 million authentication tokens and Personally Identifiable Information. A “View As” feature enabled developers to render user pages which let attackers obtain the user’s access token. This access token theft represents a major API security risk but also highlights how API risks can remain undetected for so long.  

"All companies are software companies."
- Microsoft CEO Satya Nadella

Today, as much of the security has been commodified by infrastructure providers like Amazon and Microsoft, this first generation of infrastructure suggests a deeper risk to the underlying application transportation layer i.e, its APIs. The reason that APIs are so powerful as a communication tool is the same reason that they are so vulnerable. As such, they exist in everything from “single-page” web applications to mobile apps, and even industrial IoT systems. Traditionally, API traffic moved from internal to external callers. However, modern application architectures are now enabling internal application-to-application communication, which represents a critical risk surface because of its ability to move laterally. OWASP has therefore introduced its API Security Top 10 to help make sense of this new API risk surface, which is a helpful starting point for a discussion of API risk.

Proveho Networks assists organisations in developing and maintaining API Security Practices consistent with the OWASP API Security Top 10 list of Security Risks.

API

APIs tend to expose endpoints that handle object identifiers, creating a wide attack surface Level Access Control issue. Object
level authorization checks should be considered in every function that accesses a data source using an input from the user.

Authentication mechanisms are often implemented incorrectly, allowing attackers to compromise authentication tokens or to exploit implementation flaws to assume other user’s identities temporarily or permanently. Compromising system’s ability to identify the client/user, compromises API security overall.

Looking forward to generic implementations, developers tend to expose all object properties without considering their individual sensitivity, relying on clients to perform the data filtering before displaying it to the user.

Quite often, APIs do not impose any restrictions on the size or number of resources that can be requested by the client/user. Not only can this impact the API server performance, leading to Denial of Service (DoS), but also leaves the door open to authentication flaws such as brute force.

Complex access control policies with different hierarchies, groups, and roles, and an unclear separation between administrative and regular functions, tend to lead to authorization flaws. By exploiting these issues, attackers gain access to other users’ resources and/or administrative functions.

Binding client provided data (e.g., JSON) to data models, without proper properties filtering based on a whitelist, usually lead to Mass Assignment. Either guessing objects properties, exploring other API endpoints, reading the documentation, or providing additional object properties in request payloads, allows attackers to modify object properties they are not supposed to.

Security misconfiguration is commonly a result of unsecure default configurations, incomplete or ad-hoc configurations, open cloud storage, misconfigured HTTP headers, unnecessary HTTP methods, permissive Cross-Origin resource sharing (CORS), and verbose error messages containing sensitive information.

Injection flaws, such as SQL, NoSQL, Command Injection, etc. occur when untrusted data is sent to an interpreter as part of a command or query. The attacker’s malicious data can trick the interpreter into executing unintended commands or accessing data without proper authorization.

APIs tend to expose more endpoints than traditional web applications, making proper and updated documentation highly important. Proper hosts and deployed API versions inventory also play an important role to mitigate issues such as deprecated API versions and exposed debug endpoints.

Insufficient logging and monitoring, coupled with missing or ineffective integration with incident response, allows attackers to further attack systems, maintain persistence, pivot to more systems to tamper with, extract, or destroy data. Most breach studies demonstrate the time to detect a breach is over 200 days, typically detected by external parties rather than internal processes or monitoring.

No matter how you slice it, the source of API risks is the lack of visibility into their traffic and parameters.