ModernPentestModernPentest
AI Agents

API Testing Agents

AI agents specialized for testing REST APIs

API Testing Agents

Our API testing agents specialize in finding vulnerabilities in REST APIs. They leverage your OpenAPI specification for comprehensive coverage and focus on the OWASP API Security Top 10.

Agent Overview

AgentFocus AreaOWASP API Coverage
API Auth AgentAuthentication securityAPI2 - Broken Authentication
API BOLA AgentObject authorizationAPI1 - BOLA
API Injection AgentInput validationAPI8 - Injection

API Auth Agent

Tests for authentication and authorization vulnerabilities in your API.

What It Tests

OWASP API2 - Broken Authentication

VulnerabilityDescription
JWT Algorithm ConfusionExploiting algorithm switching
JWT Signature BypassBypassing signature verification
Token Expiration IssuesTokens that don't properly expire
Session Management FlawsWeak session handling
Authentication BypassAccessing endpoints without auth

OWASP API5 - Broken Function Authorization

VulnerabilityDescription
Admin Function AccessRegular users accessing admin APIs
Privilege EscalationElevating permissions through API
Missing Authorization ChecksFunctions without permission validation

Session Security Testing

TestDescription
Token RevocationDoes logout actually invalidate tokens?
Concurrent SessionsCan multiple sessions exist?
Session FixationCan tokens be reused inappropriately?
Token BindingIs the token tied to client characteristics?

Example Finding

❌ Critical: Broken Function-Level Authorization

Endpoint: DELETE /api/api-keys/:id
CWE: CWE-285 (Improper Authorization)
OWASP: API5:2023-Broken Function Level Authorization

Issue: Regular users can delete API keys created by administrators.
       No role-based access control on DELETE operations.

Evidence:
- Admin (admin@acme.com) created API key: c93533da-4cbb-...
- Regular user (bob@acme.com, role: user) sent DELETE request
- Response: 200 OK {"message":"API key revoked"}
- Verification: Admin confirmed key no longer exists

Impact:
- Critical privilege escalation
- Regular users can disrupt operations by deleting admin API keys
- Breaks principle of least privilege
- Enables service disruption attacks

API BOLA Agent

Tests for Broken Object Level Authorization—the #1 API security risk.

What It Tests

OWASP API1 - BOLA (Broken Object Level Authorization)

VulnerabilityDescription
Cross-User Data AccessAccessing other users' objects
ID EnumerationDiscovering valid object IDs
Horizontal AccessUser A → User B's resources
Vertical AccessUser → Admin resources
Mutation AuthorizationUnauthorized PUT/DELETE

ID Fuzzing

The agent systematically tests object references:

ID TypeFuzzing Approach
Sequential1, 2, 3, ...
UUIDCommon patterns, guessable prefixes
EncodedBase64 decode, modify, re-encode
CompositeMultiple parameters combined

Example Finding

❌ Critical: Broken Object Level Authorization

Endpoint: GET /api/emails/{id}
CWE: CWE-639 (Authorization Bypass Through User-Controlled Key)
OWASP: API1:2023-Broken Object Level Authorization

Issue: Users can access emails belonging to other organizations
       by manipulating the email ID in the request path.

Evidence:
- Attacker: bob@acme.com (Org: 30484ee6-d0ae-...)
- Victim: admin@techstart.com (Org: 651c50a4-6e85-...)
- Request: GET /api/emails/2580b047-ca95-41ae-acf8-e2daeb699884
- Response: 200 OK with victim's full email data

Data Exposed:
- from, to, subject, text content
- organizationId, status, timestamps

Impact:
- Complete breach of multi-tenant data isolation
- Confidential email content exposed to unauthorized parties
- Attackers can enumerate and read all emails across organizations

API Injection Agent

Tests for injection vulnerabilities specific to APIs.

What It Tests

OWASP API8 - Injection

VulnerabilityDescription
SQL InjectionDatabase manipulation via API parameters
NoSQL InjectionMongoDB operator injection
Command InjectionOS command execution
XXE InjectionXML parsing vulnerabilities
Path TraversalFile system access
Header InjectionHTTP header manipulation

API-Specific Testing

Unlike web injection testing, API injection focuses on:

  • JSON payloads - Injection in request bodies
  • Query parameters - URL parameter manipulation
  • Path parameters - Injection in URL paths
  • Headers - Authorization, custom headers

NoSQL Injection Testing

For APIs using MongoDB or similar:

// Normal request
{"username": "admin"}

// Injection payloads
{"username": {"$ne": null}}      // Always true
{"username": {"$gt": ""}}        // Greater than empty
{"username": {"$regex": ".*"}}   // Regex match all

Example Finding

❌ High: NoSQL Injection

Endpoint: POST /api/v1/users/login
Parameter: username, password (request body)
CWE: CWE-943 (Improper Neutralization of Special Elements in Data Query Logic)
OWASP: API8:2023-Injection

Issue: Login endpoint accepts MongoDB operators in JSON body,
       allowing authentication bypass without valid credentials.

Evidence:
- Normal request: {"username": "admin", "password": "secret"}
- Attack payload: {"username": {"$ne": null}, "password": {"$ne": null}}
- Response: 200 OK with valid JWT token for first user in database

Verification:
- Decoded JWT shows: {"sub": "507f1f77bcf86cd799439011", "role": "admin"}
- Attacker gained admin access without knowing any credentials

Impact:
- Complete authentication bypass
- Unauthorized access to any account
- Potential data exfiltration as admin user
- No audit trail linking attacker to legitimate user

Parallel API Testing

After OpenAPI analysis, specialized agents run simultaneously:

AgentTarget EndpointsFocus
API Auth Agent/auth/*, JWT tokens, sessionsAuthentication bypass, token security
API BOLA AgentAll endpoints with path params (/users/{id})Object authorization, cross-user access
API Injection AgentAll parametersSQL/NoSQL injection, command injection

All findings then flow into the Consolidation phase for deduplication and validation.

OpenAPI Integration

Providing your OpenAPI spec improves testing:

With OpenAPI Spec

  • ✅ All endpoints tested
  • ✅ Correct parameter types
  • ✅ Authentication requirements known
  • ✅ Expected responses validated

Without OpenAPI Spec

  • ⚠️ Limited to discovered endpoints
  • ⚠️ Generic payload types
  • ⚠️ Manual auth configuration
  • ⚠️ Reduced coverage

For best results, provide a complete and up-to-date OpenAPI specification when adding your API to ModernPentest.

Next Steps

Last updated: December 8, 2025

On this page