Broken API authentication: Cloud security risks explained

Key takeaways:
  • Broken API authentication occurs when an API fails to correctly verify the caller’s identity – whether that caller is a human user or a service – due to misconfigured, absent, or weak authentication controls. Broken authentication and session management API risks can cause security, compliance, and performance issues in the cloud. 

  • Broken authentication and session management API risks may appear in the cloud as missing JSON Web Token (JWT) validation, weak API key management, API credential stuffing, session hijacking, metadata exploits, man-in-the-middle (MITM) attacks, and OAuth misconfigurations.

  • The best broken API authentication mitigation strategies map authentication flows, use proven standards, limit session length, and introduce multi-factor authentication (MFA). Further strategies include warding off brute-force attacks, using resources like the OWASP Authentication Cheatsheet, and commissioning a cloud security platform like Wiz.

What is broken API authentication?

Broken API authentication is an API security risk that occurs when an API doesn’t properly check and confirm who’s making a certain request. This typically stems from misconfigured, absent, or subpar authentication controls. 

APIs that blindly trust user inputs or don’t enforce multi-layered authentication controls are extremely risky. Why?

Because broken user authentication in APIs is exactly what adversaries need to: 

  • Gain access to sensitive data 

  • Take over legitimate user accounts, or 

  • Move laterally across federated cloud environments

Broken API authentication ranks high in the OWASP Top 10 API Security Risks list, another reminder to businesses to raise awareness and develop strong mitigation strategies. Even a minor instance of this OWASP authentication risk can lead to large-scale incidents. 

Considering that almost every enterprise faces API security issues, e.g., broken authentication attacks, this is an urgent concern. And if you’re wondering what kind of damage might transpire from broken user authentications, Gartner says API breaches leak 10 times more data than regular breaches.

But worry not. This article has you covered, providing actionable guidance on how to mitigate dangerous broken authentication OWASP risks

Advanced API Security Best Practices [Cheat Sheet]

Download the Wiz API Security Best Practices Cheat Sheet and fortify your API infrastructure with proven, advanced techniques tailored for secure, high-performance API management.

What does broken API authentication look like?

Here are some concrete examples of what broken authentication and session management risks might look like in your API-driven environment: 

  • Missing JWT validation: Failure to verify the token’s digital signature, issuer (iss), audience (aud), expiration (exp), and algorithm. This gap enables attackers to use forged, expired, or replayed tokens to bypass API authentication.

  • Weak API key management: Use of long-lived or plaintext API keys, missing rotation, overbroad permissions, and lack of client binding. Prefer short-lived, scoped tokens (like OAuth 2.0 access tokens) or signed requests (such as AWS Signature Version 4) over raw API keys.

  • API credential stuffing: Automated replay of breached username/password pairs across API endpoints. Mitigate with rate limiting, IP reputation checks, and additional authentication challenges after repeated failures.

  • Session hijacking or token replay: Instances where threat actors exploit stolen session tokens to access a legitimate session in an API-driven resource; enables adversaries to conduct malicious activities under the guise of a legitimate user 

  • Cloud metadata API exploit: Server-Side Request Forgery (SSRF) or misconfiguration allows attackers to access instance metadata endpoints (e.g., 169.254.169.254) and steal temporary credentials. Mitigate by enforcing AWS IMDSv2, using metadata concealment in GCP, and restricting egress traffic.

  • Man-in-the-middle attack: Interception or downgrade of authentication traffic. Mitigate with TLS 1.2 or higher, strict certificate validation, HTTP Strict Transport Security (HSTS) for browsers, and mutual TLS (mTLS) or Demonstration of Proof-of-Possession (DPoP) to bind tokens to clients.

  • OAuth misconfiguration: Weak redirect URI validation, missing Proof Key for Code Exchange (PKCE) for public clients, overbroad scopes, or misuse of OAuth grant types. These flaws enable token theft and privilege escalation.

Why is broken API authentication so dangerous in the cloud?

Cloud resources are distributed, complex, fast-paced, and ephemeral. And don’t forget that they’re stitched together using APIs. In busy API-driven cloud environments, risks like broken authentication can evade detection. 

And what happens if a business has a subpar API governance posture in a sprawling multi-vendor estate? Identifying authentication flaws before they’re exploited is virtually impossible. 

Figure 1:Wiz automatically discovers managed and unmanaged APIs across your cloud environments 

API-centric broken user authentication attacks are more than just security risks—they’re regulatory time bombs. 

Now that businesses face stricter compliance standards and data sovereignty laws, broken user authentication across APIs can be a one-way ticket to major GDPR, PCI DSS, and HIPAA noncompliance events—with loss of customer trust and reputation close behind. 

Next, there are the technical aspects of why broken API authentication is doubly complicated in multi-vendor environments. A single API flaw in a federated cloud estate provides adversaries a foothold to move laterally and access sensitive resources.

How would broken API authentication play out in the real world? 

Imagine this: Your Amazon API Gateway with inadequate token validation controls accepts a forged JWT. This creates a pathway for unauthorized access to an S3 bucket containing high-risk PHI. 

In this very plausible example, a single instance of broken API authentication could result in a data breach, a HIPAA violation, customer churn, and legal investigations.

Figure 2: Wiz’s dynamic scanner identifies effective exposures 

In no uncertain terms, broken API authentication in the cloud is an existential threat. 

How to mitigate broken authentication attacks?

So, now we know: Broken API authentication can wreak havoc on enterprise cloud environments. The question of the hour is: How do you mitigate broken user authentication and similar API risks before they’re exploited? 

Let’s review some clear, actionable strategies. 

Map authentication flows

First move? Develop a high-level authentication topology to capture how users and services authenticate across your environment. This reveals the true API attack surface. Next, you need to map, monitor, and secure every authentication flow you find. 

Pro tip: You’ll need to work closely with your various cloud teams to accurately map authentication flows. The more collaborative the process, the fewer the blind spots. 

Use proven authentication, password storage, and token generation standards

Don’t be adventurous with API authentication, token generation, and password storage. Skip unusual standards, and don’t bother designing your own. The risks aren’t worth it. Instead, opt for tried-and-tested methods:

  • Use delegation protocols and authentication standards like OAuth 2.0, JWTs, OpenID Connect, and API keys.

  • For password storage, choose hashing algorithms such as Argon2 or bcrypt. 

  • For token generation, use cryptographically secure random generators from well-known libraries. 

Limit session length

Enforce short-lived access tokens (for example, 15 minutes or less), rotate refresh tokens regularly, and support token revocation or introspection to minimize the window for token replay attacks.

Choosing the right session is tricky. It has to offer legitimate end users a productive experience without allowing unauthorized users to escalate attacks or compromise sensitive data. 

Pro tip: Introduce controls that automatically log users out after a specified session length. 

Introduce controls like MFA

Apply multi-factor authentication (MFA) for human logins and high-risk actions like privilege escalation. For service-to-service API calls, use mutual TLS (mTLS), private networking, or token binding (such as DPoP) instead of MFA.

MFA is a great first line of defense, but it’s also useful when users attempt account changes or privilege escalation. 

Another benefit of MFA? Even if threat actors get a hold of stolen credentials, there is only so much they can do. 

Strategize against brute-force attacks

APIs are magnets for brute-force attacks, e.g., dictionary attacks, credential stuffing, and rainbow table attacks. Preventing these incidents requires controls purpose-built to resist brute-force attempts. 

CAPTCHAs can get the ball rolling, but don’t stop there. Bring in login throttling, account lockouts, and extra stringent rate limiting. 

And don’t forget monitoring controls. These detect indicators of brute-force attacks and cut off threats at the source. 

Follow the OWASP Authentication Cheatsheet

The OWASP Authentication Cheatsheet is a powerful resource to support your API security initiatives. 

What are the benefits of following broken authentication OWASP recommendations and strategies? Simple: a smaller blast radius and fewer broken authentication attacks. 

Commission a cloud-native API security solution 

Protecting cloud APIs requires a purpose-built cloud security solution. There are a lot of options out there, so know exactly what you need. 

Look for a cloud-native tool that can easily click into CI/CD pipelines. And make sure that it supports SAST, DAST, and API fuzzing techniques to catch broken API authentication as early as possible. 

A few other security capabilities to look out for:

  • IaC scanning

  • IDE integrations

  • Real-time API monitoring

  • Unification with security orchestration platforms to support automated remediation workflows

Figure 3: Wiz creates a topology of cloud APIs

A non-negotiable? No silos. That means that all the features listed above must be unified into one platform. Like Wiz!

How Wiz prevents broken API authentication in the cloud

In the cloud, you can’t look at API security in isolation. Instead, just like APIs themselves, you need to connect them to other parts of the cloud. This type of interconnected and unified visibility and security is exactly what Wiz provides. 

Wiz is a full-stack CNAPP with strong API security capabilities. It automatically discovers managed and unmanaged APIs, correlates endpoints to cloud identities, data, and exposure paths on the Security Graph, and validates real exposure with a dynamic API scanner. 

Teams can trace broken authentication issues from runtime back to code, enforce guardrails in IDE/PR/CI, and prioritize fixes based on blast radius – for example, an internet-exposed endpoint with access to a sensitive data store and missing PKCE. Wiz also supports rapid containment and remediation of API incidents by using runtime sensor signals and cloud logs.

Wiz also supports rapid containment and remediation of API incidents by using runtime sensor signals and cloud logs. 

Figure 4: Wiz’s risk-based approach to mitigating API authentication issues

Ready to catch broken authentication and session management risks before they compromise your cloud environment? 

Get a demo to see how Wiz provides the visibility and context you need to secure your APIs from code to runtime.

Catch code risks before you deploy

Learn how Wiz Code scans IaC, containers, and pipelines to stop misconfigurations and vulnerabilities before they hit your cloud.

Per informazioni su come Wiz gestisce i tuoi dati personali, consulta il nostro Informativa sulla privacy.