Penetration Testing

How to Test API2:2023 Broken Authentication in 2026

Tejas K. Dhokane, Marketing Associate at AppSecure Security
Tejas K. Dhokane
Marketing Associate
A black and white photo of a calendar.
Updated:
September 14, 2026
•
A black and white photo of a clock.
12
mins read
Tejas K. Dhokane, Marketing Associate at AppSecure SecurityVijaysimha Reddy, Security Engineering Manager at AppSecure
Written by
Tejas K. Dhokane
, Reviewed by
Vijaysimha Reddy
A black and white photo of a calendar.
Updated:
September 14, 2026
•
A black and white photo of a clock.
12
mins read
How to Test API2:2023 Broken Authentication
On this page
Share

API2:2023 Broken Authentication covers the authentication and token-handling flaws attackers use to impersonate legitimate users on an API — credential stuffing, weak JWT validation, session fixation, and password reset abuse. Testing it requires manual verification of every login, token issuance, and session-management flow; a scanner that only fuzzes a login form will miss the logic flaws that actually get exploited.

TL;DR

  • API2:2023 Broken Authentication ranks second in the OWASP API Security Top 10 and covers credential stuffing, JWT flaws, and session management gaps.
  • Manual testing of token issuance, refresh, and revocation logic catches authentication bypasses that automated scanners miss entirely.
  • PCI DSS, SOC 2, and ISO 27001 all require documented evidence of authentication testing, not just a vulnerability scan output.
  • A full API2 assessment maps every authentication mechanism in the API — not just the primary login endpoint — before testing begins.

Why This Matters

Broken authentication on an API is not a cosmetic finding. It is a direct path to account takeover, data exfiltration, and — for regulated businesses — a reportable breach. Unlike a web application login page, an API often exposes dozens of authentication-adjacent endpoints: token refresh, password reset, MFA enrollment, session revocation, and third-party OAuth callbacks. Each one is a separate attack surface.

In 2026, API-first architectures mean authentication logic is frequently duplicated across mobile clients, partner integrations, and internal microservices, each implementing the same OWASP API2:2023 category differently. A flaw in one implementation rarely stays isolated — it propagates to every service trusting the same token. That is why API penetration testing engagements treat authentication as a dedicated workstream, not a checklist item inside a broader scan.

What OWASP API2:2023 Broken Authentication Covers

API2:2023 groups together every weakness that lets an attacker acquire, forge, or reuse authentication credentials or tokens without proper authorization. This includes:

  • Missing or weak rate limiting on login and OTP endpoints, enabling credential stuffing and brute force
  • Weak JWT signature validation, including algorithm confusion (alg:none) and accepting unsigned or self-signed tokens
  • Long-lived or non-revocable tokens that remain valid after logout, password change, or account suspension
  • Insecure password reset and account recovery flows that leak valid reset tokens or skip identity verification
  • Missing or bypassable multi-factor authentication on high-privilege actions
  • API keys or client secrets hardcoded into mobile apps or exposed in public repositories

Where API Authentication Testing Differs From Web App Auth Testing

Web application authentication testing (mapped in OWASP A07:2021 authentication failures) focuses heavily on session cookies, CSRF tokens, and browser-based session fixation. API authentication testing shifts the focus to stateless tokens, machine-to-machine credentials, and mobile-to-backend trust. A JWT issued to a mobile client behaves differently than a server-side session cookie — it can be replayed across devices, decoded client-side, and forged if the signing key is weak or exposed. Testers who apply web-app assumptions to an API engagement consistently miss token-specific attack paths.

How to Test for Broken Authentication in APIs: The Methodology

A defensible API2:2023 assessment follows a repeatable sequence. Skipping steps — particularly attack-surface mapping — is the most common reason internal teams miss authentication flaws that a dedicated penetration test later confirms.

Step 1: Define Scope and Prerequisites

Confirm which authentication mechanisms are in scope: username/password, OAuth 2.0, API keys, mTLS, SSO via SAML or OIDC. Obtain test accounts at every privilege tier and at least two tenants if the API is multi-tenant. Document the token format (JWT, opaque, PASETO) and signing algorithm before testing starts.

Step 2: Map the Authentication Attack Surface

Enumerate every endpoint that touches authentication state: login, token refresh, logout, password reset, MFA enrollment/verification, session listing, API key generation, and OAuth callback URLs. Include internal service-to-service authentication if it shares infrastructure with customer-facing APIs. Missed endpoints are the single largest source of false negatives in API2 testing.

Step 3: Build Test Cases by Authentication Mechanism

Password/credential login

  • Primary Test Cases: Rate limiting, account enumeration, credential stuffing resistance
  • Tooling Approach: Manual scripted requests, Burp Intruder

JWT / bearer tokens

  • Primary Test Cases: Algorithm confusion, signature stripping, expired token acceptance, key confusion (RS256 to HS256)
  • Tooling Approach: Manual decoding and re-signing, jwt_tool

OAuth 2.0 / OIDC

  • Primary Test Cases: Redirect URI validation, state parameter reuse, authorization code interception
  • Tooling Approach: Manual flow replay, PortSwigger OAuth labs methodology

Session/token revocation

  • Primary Test Cases: Token validity after logout, password change, or account suspension
  • Tooling Approach: Manual timing tests across sessions

Password reset / recovery

  • Primary Test Cases: Token predictability, token reuse, missing identity re-verification
  • Tooling Approach: Manual token analysis across multiple requests

MFA

  • Primary Test Cases: Bypass via response manipulation, missing enforcement on sensitive endpoints
  • Tooling Approach: Manual step-skipping and parameter tampering

Step 4: Capture Evidence and Validate Exploitability

Every finding needs a reproducible request/response pair, not a scanner alert. For JWT algorithm confusion, capture the original token, the forged token, and the successful authenticated response using the forged credential. A finding without a validated, reproducible exploit path gets deprioritized by engineering — and rightly so.

Step 5: Check for False Positives

Rate-limiting findings are the most common false positive in API2 testing: a WAF or CDN may absorb brute-force attempts before they reach the application layer, masking an application-level gap. Confirm rate limiting exists at the application layer independent of any perimeter control before reporting it as a vulnerability.

Step 6: Verify Remediation and Retest

After the engineering team patches a finding — say, enforcing signature validation on JWTs — retest the exact exploit path, not just the patched code path. Attackers pivot; a fix that closes one bypass often leaves an adjacent one (e.g., algorithm confusion fixed, but expired-token acceptance untouched).

Step 7: Report Findings With Business Context

A finding titled "weak JWT validation" means nothing to a compliance auditor or a board. Frame each finding by business impact: "An attacker can forge a valid session token for any user account without credentials, resulting in full account takeover across the platform."

Key API2 Test Cases and What They Reveal

JWT algorithm confusion (alg:none)

  • Business Impact: Full authentication bypass, any account impersonation
  • Testing Priority: Critical

Missing rate limiting on login/OTP

  • Business Impact: Credential stuffing at scale, account takeover
  • Testing Priority: Critical

Non-revoked tokens post-logout

  • Business Impact: Persistent unauthorized access after user believes session is closed
  • Testing Priority: High

Predictable password reset tokens

  • Business Impact: Account takeover via forged reset link
  • Testing Priority: High

Hardcoded API keys in mobile binaries

  • Business Impact: Backend compromise via extracted credentials
  • Testing Priority: High

MFA bypass on sensitive endpoints

  • Business Impact: Defeats a compensating control regulators expect to be enforced
  • Testing Priority: High

Why Automated Scanners Miss Broken Authentication

Scanners are effective at detecting missing headers, outdated libraries, and known CVE signatures. They are structurally weak at detecting business-logic authentication flaws because those flaws require understanding intent — does this token should still be valid, does this reset flow should require identity re-verification. A scanner cannot answer "should."

Manual testers exploit this gap by chaining findings: a low-severity information disclosure (verbose error messages during login) combined with a missing rate limit becomes a practical account takeover path. This is the core argument for manual API penetration testing over scan-only programs — vulnerability chaining is a human analytical process, not a signature match.

AppSecure Security's hacker-led testing approach applies this same chaining discipline to every engagement, whether the target is a standalone API, an SSO implementation, or a broader application stack. Testers validate exploitability manually before any finding reaches a report.

Compliance Mapping: Where API2 Testing Fits Regulatory Requirements

|

F r a m e w o r k

PCI DSS 4.0

  • What Assessors Check: Strong authentication for all access to cardholder data environments
  • Testing Implication: MFA enforcement, session timeout evidence, authentication logs

SOC 2

  • What Assessors Check: Logical access controls (CC6 series)
  • Testing Implication: Documented access provisioning, authentication mechanism review

ISO 27001

  • What Assessors Check: Access control policy (Annex A.9/A.5.15)
  • Testing Implication: Evidence of periodic authentication testing

NIST 800-53 / CSF

  • What Assessors Check: Identification and authentication (IA family)
  • Testing Implication: MFA enforcement, credential lifecycle management

HIPAA

  • What Assessors Check: Access control safeguards for ePHI systems
  • Testing Implication: Unique user authentication, automatic logoff

Regulators and auditors increasingly expect authentication testing evidence that goes beyond a login-page scan. A PCI DSS QSA reviewing a Level 1 merchant's payment gateway penetration test will ask for proof that token revocation and MFA enforcement were tested, not assumed.

API2 Broken Authentication Testing Checklist

  • Rate limiting validated at the application layer on login, OTP, and password reset endpoints
  • JWT signature validation tested against algorithm confusion and key substitution
  • Token revocation confirmed on logout, password change, and account suspension
  • Password reset tokens tested for predictability and reuse across sessions
  • MFA enforcement verified on every sensitive action, not just initial login
  • OAuth/OIDC redirect URIs and state parameters validated against interception
  • Hardcoded credentials and API keys checked in mobile binaries and client-side code
  • Findings retested against the exact original exploit path after remediation

How AppSecure Tests for API Broken Authentication

AppSecure Security runs API2:2023 assessments as a dedicated authentication workstream inside every API penetration test, rather than a subset of a general scan. Testers manually map every authentication and token-handling endpoint, attempt algorithm confusion and token forgery by hand, and validate whether revoked or expired tokens still grant access. Every finding is chained against adjacent flaws — access control, rate limiting, session management — to demonstrate real-world exploitability, not theoretical risk.

This is the same hacker-led methodology applied across AppSecure Security's broader offensive testing programs, calibrated to the authentication architecture in front of the tester rather than a fixed checklist.

FAQ

What is API2:2023 Broken Authentication in the OWASP API Security Top 10?

API2:2023 Broken Authentication is the OWASP API Security Top 10 category covering flaws in how an API verifies identity and manages tokens, including weak JWT validation, missing rate limiting, and non-revocable sessions. It ranks second in the 2023 edition, reflecting how frequently authentication bypasses lead to account takeover.

How do you test for broken authentication in an API?

Testing broken authentication in an API means manually mapping every authentication-adjacent endpoint (login, token refresh, password reset, MFA, revocation), then attempting token forgery, algorithm confusion, and rate-limit bypass against each one. Automated scanners rarely catch these flaws because they require understanding business logic, not signature matching.

What is JWT algorithm confusion and why is it critical?

JWT algorithm confusion happens when an API accepts a token signed with a different algorithm than it expects, such as switching from RS256 to HS256 using the public key as the HMAC secret. It is rated critical because a successful attack forges a valid authentication token for any user without credentials.

Does PCI DSS require API authentication testing?

PCI DSS 4.0 requires strong authentication controls for any system with access to cardholder data, which includes APIs connected to the cardholder data environment. Assessors expect evidence of MFA enforcement and session/token expiry testing, not just a general vulnerability scan.

Can automated tools fully test for broken authentication?

No. Automated scanners detect missing security headers and known CVEs but cannot evaluate whether a token should still be valid after logout or whether a password reset flow correctly re-verifies identity. Manual testing is required to validate these business-logic-dependent flaws.

How often should API authentication be penetration tested?

Authentication mechanisms should be tested at every major release that touches login, token issuance, or session management, and at minimum annually for compliance-driven programs. Continuous or release-cycle testing catches regressions that annual-only testing misses.

What is the difference between API2:2023 and OWASP A07:2021?

OWASP A07:2021 (web application Top 10) covers authentication failures in traditional session-based web apps, while API2:2023 focuses on stateless token authentication, machine-to-machine credentials, and mobile-to-backend trust models specific to APIs.

What evidence does a SOC 2 auditor expect for authentication testing?

SOC 2 auditors under the CC6 control series expect documented evidence that access and authentication mechanisms were tested, including how tokens are issued, rotated, and revoked, not just a description of the control design.

Does MFA fully mitigate API2 Broken Authentication risk?

No. MFA reduces risk on the initial login but does not protect against token forgery, non-revoked sessions, or weak password reset flows that occur after authentication. Testing must cover the full token lifecycle, not just the login step.

One Last Thing

The finding that most often surprises engineering teams is not algorithm confusion — it is discovering that a token remains valid for hours or days after a user logs out, changes their password, or is suspended by an admin. Revocation logic is frequently implemented as a client-side action (deleting a local token) rather than a server-side invalidation, which means the token keeps authenticating requests indefinitely. Test revocation explicitly; do not assume logout means logout.

Related Guides

An internal review or a scanner report will not tell you whether your API's authentication logic survives a determined attacker in 2026 — only a manual, hacker-led test will. Talk to AppSecure about scoping an API2:2023 authentication assessment before your next audit cycle or release.

Tejas K. Dhokane, Marketing Associate at AppSecure Security
Tejas K. Dhokane

Tejas K. Dhokane is a marketing associate at AppSecure Security, driving initiatives across strategy, communication, and brand positioning. He works closely with security and engineering teams to translate technical depth into clear value propositions, build campaigns that resonate with CISOs and risk leaders, and strengthen AppSecure’s presence across digital channels. His work spans content, GTM, messaging architecture, and narrative development supporting AppSecure’s mission to bring disciplined, expert-led security testing to global enterprises.

Protect Your Business with Hacker-Focused Approach.

Loved & trusted by Security Conscious Companies across the world.
Stats

The Most Trusted Name In Security

450+
Companies Secured
7.5M $
Bounties Saved
4800+
Applications Secured
168K+
Bugs Identified
Accreditations We Have Earned
crest logo white
AICPA SOC 2 badge logo

Protect Your Business with Hacker-Focused Approach.