Blog

Virtual Patching: A Proactive Approach to API Security

October 3, 2024 | 6 MIN READ

by Varun Kohli

Stylized image of a bandage patching a separation between two panels

In the API-driven world of modern enterprises, security vulnerabilities such as Broken Object Level Authorization (BOLA) represent one of the more insidious threats. These weaknesses are often exploited by attackers through bot-driven automation and can lead to data breaches and privacy violations. It’s not always convenient or even possible to immediately remediate the problem through code fixes, which must be implemented, tested, and then moved to production. A popular alternative that is effective and quick to implement is virtual patching, which protects vulnerable API endpoints without the need for immediate code changes. In a recent incident, our team at Cequence Security successfully detected and mitigated a major BOLA vulnerability using virtual patching. Here’s a detailed look at what happened, how it was detected, and how virtual patching played a pivotal role in remediation.

What are BOLA Vulnerabilities?

What exactly is a BOLA vulnerability? Broken object level authorization (BOLA) is a security vulnerability that occurs when an application or application programming interface (API) provides access to data objects based on the user’s role but fails to verify if the user is authorized to access those specific data objects.

The Danger of BOLA Vulnerabilities

BOLA vulnerabilities rank among the OWASP API Security Top 10 due to their high potential for exploitation and the direct access it gives to sensitive data. When attackers successfully exploit a BOLA vulnerability, they can retrieve sensitive user data by manipulating object identifiers, bypassing normal authorization checks. These attacks are typically carried out by bots, programmed to rapidly scrape and exfiltrate data. Left unchecked, they can result in massive data breaches and regulatory compliance violations, including penalties under GDPR, HIPAA, or PCI DSS.

The Incident: A Broken Object Level Authorization Vulnerability Unveiled

Last month at one of the largest dating sites in the world, an anomalous user session journey behavior triggered an alert in the Cequence Unified API Protection platform. The anomalous traffic was traced to a specific API that allowed unauthenticated access to certain user information – a glaring BOLA vulnerability. While Cequence was able to confirm that the vulnerability was not being actively exploited, the vulnerability remained and could be exploited at any time, which risked privacy violations and reputational damage for the company.

Detection: How Our Systems Uncovered the Anomaly

One of the core strengths of the Cequence platform is its ability to detect deviations from normal traffic behavior. By leveraging machine learning and historical baselines, the system can distinguish between ordinary traffic fluctuations and potential security threats. In this case, the Cequence ML models analyzed session patterns across the platform and flagged the sudden surge in requests to the API endpoint. These requests were tied to IP addresses from known hosting providers and residential proxies, a hallmark of bot-driven attacks. This abnormal traffic was a clear signal that something was amiss — prompting our team to take immediate action. By correlating these observations with a lack of authentication in the request headers, it became evident that attackers could take advantage of a BOLA vulnerability in this API endpoint.

Mitigation: The Role of virtual patching in Securing APIs

In order to mitigate the vulnerability as quickly as possible, Cequence recommended implementing virtual patching, a real-time, scalable remedy that secures API endpoints without requiring changes to the underlying codebase. Virtual patching provides an immediate fix to vulnerabilities by enforcing security policies within Cequence, enabling rapid protection even as developers work on permanent code-level patches. Here’s how Cequence virtual patching works:

  1. Immediate Enforcement of Security Policies: Policies can be swiftly implemented to protect the API endpoints from known vulnerabilities such as the BOLA vulnerability in this example. Any API calls lacking proper authentication can be immediately blocked, cutting off attackers’ access to user data.
  2. Dynamic and Adaptive Protection: One of the key benefits of virtual patching is its adaptability. As attacks evolve, so do the rules and policies that virtual patching enforces.
  3. Zero Impact on Development Cycles: Virtual patching enables security measures to be applied in real time, allowing the development team to work on permanent fixes without interrupting normal operations. This makes it a perfect solution for fast-moving enterprises that rely heavily on APIs but can’t afford downtime or extended patching windows.

The Growing Importance of virtual patching in API Security

As enterprises continue to scale their digital operations, and with the advent of Generative AI applications, the number of APIs they rely on will only increase. With this expansion comes a greater need for robust, scalable security measures, and virtual patching offers a flexible, real-time remedy that fills the security gaps left by traditional patching processes. Traditional patching can be time-consuming and disruptive, especially in environments with frequent deployments or where development and operations teams work in silos. In contrast, virtual patching operates independently of development cycles, allowing for immediate protection while long-term fixes are developed in parallel.

Best Practices for Implementing virtual patching

To get the most out of virtual patching in API security, it is recommended to follow these best practices:

  1. Continuous Monitoring: Always monitor API traffic for any deviations from normal behavior. Machine learning models help detect these anomalies quickly and accurately.
  2. Layered Security: Use virtual patching as part of a broader, layered security approach that includes proper API governance, testing, and compliance checks to ensure comprehensive protection across the API lifecycle.
  3. Tailored Security Policies: Customize virtual patching policies to address specific vulnerabilities. For example, enforcing cookie validation or rate limiting for certain API endpoints can prevent unauthorized access or data scraping attempts.
  4. Collaborative Feedback: Work closely with your security and development teams to gather insights from both sides. Virtual patching allows for flexible feedback loops, enabling continuous improvement of your security policies.

In an increasingly API-dependent world, security vulnerabilities such as BOLAs continue to pose serious risks. However, with the right tools, such as virtual patching, enterprises can stay ahead of attackers and protect their digital assets in real-time. Cequence’s superior detection and mitigation capabilities ensure that your API ecosystem remains safe, no matter how quickly it grows or changes. To get started easily, get a free API security assessment and see what your attacker sees.

Varun Kohli

Author

Varun Kohli

CMO

Varun Kohli, CMO at Cequence, formerly led marketing teams at Feedzai, Symantec, McAfee and ArcSight. Featured in major publications and broadcasts, Varun has contributed to 9 successful company exits. He holds degrees from IIT Guwahati, UC Riverside and UC Berkeley.

Related Articles