Executive Summary
Target: OWASP crAPI (GitHub)Assessment Date: September 2025
Scope: Authentication, XSS, SQL and Command Injection, SSRF, Authorization testing Shannon identified over 15 critical and high-severity vulnerabilities, achieving full application compromise of crAPI, a modern intentionally vulnerable API from OWASP designed to benchmark tools against the OWASP API Security Top 10.
Key Accomplishments
Complete Application Compromise
- Bypassed authentication using multiple advanced JWT attacks: Algorithm confusion, alg:none, and weak key (kid) injection
- Achieved full database compromise via injection attacks: Exfiltrated user credentials from PostgreSQL database
- Executed critical Server-Side Request Forgery (SSRF): Successfully forwarded internal authentication tokens to external service
- Demonstrated high accuracy: Correctly identified robust XSS defenses with zero false positives
Verified Vulnerabilities by Category
Authentication Vulnerabilities:- JWT algorithm confusion attacks (RS256 to HS256)
- Unsigned JWT token acceptance (alg:none bypass)
- JWT JKU header SSRF exploitation
- JWT KID header injection with weak key exploitation
- Unlimited brute force capabilities (login and OTP endpoints)
- Unauthenticated access to sensitive order data with payment information
- Horizontal privilege escalation between user accounts
- Regular users accessing mechanic-only functionality
- Business logic bypasses for unlimited store credit accumulation
- No XSS vulnerabilities found - Application code analysis identified potential sinks but exploitation blocked by input validation and framework protections
- PostgreSQL SQL injection in coupon validation endpoint
- Complete database compromise with credential extraction
- MongoDB NoSQL injection bypassing query filters
- Command injection in video processing (internal network protected)
- Critical SSRF through contact mechanic endpoint
- Complete internal network access with credential theft
- Retry mechanism for persistent attacks
- Authorization header forwarding to external services
Critical Vulnerability Examples
AUTH-VULN-04: JWT Algorithm Confusion Attack (RS256 to HS256)
Severity: CriticalLocation: JWT validation in
services/identity/src/main/java/com/crapi/config/JwtProvider.javaImpact: Complete authentication bypass with admin privilege escalation Prerequisites: Access to RSA public key from
/.well-known/jwks.json
Exploitation:
- Extract RSA public key from JWKS endpoint:
-
Obtain legitimate JWT token by logging in as
[email protected] / Test!123 -
Create forged JWT token using algorithm confusion:
- Change header algorithm from
"alg": "RS256"to"alg": "HS256" - Modify payload role from
"role": "user"to"role": "admin" - Change subject from
[email protected]to[email protected] - Sign using HMAC-SHA256 with RSA public key as secret
- Change header algorithm from
- Test forged token against dashboard endpoint:
- Original token: User access to
[email protected]account - Forged token: Admin access to
[email protected]account with elevated privileges - Response included sensitive admin dashboard data confirming privilege escalation
/source/jwt_algorithm_confusion_attack.py demonstrates complete attack chain with 100% success rate. The vulnerability exists because the application accepts JWT tokens signed with HMAC (HS256) when it expects RSA (RS256), allowing attackers to use the public key (which is publicly available) as the HMAC secret.
AUTH-VULN-05: JWT ‘None’ Algorithm Authentication Bypass
Severity: CriticalLocation: JWT validation accepts unsigned tokens with
"alg": "none"Impact: Full access to admin account without any cryptographic verification Prerequisites: None Exploitation:
-
Create unsigned JWT token with admin privileges:
- Header:
{"alg": "none"} - Payload:
{"sub": "[email protected]", "iat": 1758655244, "exp": 1759260044, "role": "admin"} - Signature: Empty (unsigned token format:
header.payload.)
- Header:
- Test unsigned token:
- HTTP 200 response with full admin dashboard access
- Retrieved sensitive admin account information including credentials
- Complete bypass of all authentication mechanisms
alg:none, which means no signature verification is performed. This completely bypasses authentication by allowing anyone to craft arbitrary tokens with any claims.
AUTH-VULN-06: JWT JKU Header SSRF Exploitation
Severity: HighLocation: JKU header processing in JWT validation
Impact: Internal network reconnaissance and potential cloud metadata access Prerequisites: Ability to craft JWT tokens with JKU headers Exploitation:
- Create JWT with malicious JKU header pointing to internal resources:
- Test internal network access:
http://192.168.1.1/admin(10.0s timeout - confirms internal network access)http://10.0.0.1/status(10.3s timeout - confirms internal routing)http://172.16.0.1/health(10.3s timeout - confirms private IP access)
- Confirmed SSRF capability through timeout analysis
- Server makes HTTP requests to attacker-controlled URLs
- Internal network ranges (RFC 1918) are accessible
- Potential for cloud metadata service access (169.254.169.254)
INJ-VULN-03: PostgreSQL SQL Injection via Coupon Validation
Severity: CriticalLocation:
/workshop/api/shop/apply_coupon endpoint, coupon_code parameterImpact: Full database compromise with extraction of user credentials Prerequisites: Valid JWT authentication token Exploitation:
- Authenticate and obtain JWT token:
- Confirm SQL injection vulnerability:
- Extract database version information:
PostgreSQL 14.19 (Debian 14.19-1.pgdg13+1) on x86_64-pc-linux-gnu
- Extract sensitive user credentials:
[email protected]:$2a$10$TwbchLEy4653ENobgxRKjemiHlnQE98CPncJYVhFeIfCLeicefAPG
Proof of Impact:
- Database Version Extracted: PostgreSQL 14.19 (Debian 14.19-1.pgdg13+1)
- Database User: admin (high privileges)
- Database Name: crapi
- Complete Table Enumeration: 25 tables including sensitive user data
- Password Hash Extracted: BCrypt hashes from user_login table
coupon_code parameter before using it in SQL queries.
INJ-VULN-04: MongoDB NoSQL Injection via Community Coupon Validation
Severity: HighLocation:
/community/api/v2/coupon/validate-coupon endpointImpact: Unauthorized access to MongoDB coupon collection Prerequisites: Valid JWT authentication token Exploitation:
- Test basic endpoint functionality:
{} (empty object for non-existent coupon)
- Exploit with $ne operator to extract data:
{"coupon_code":"TRAC075","amount":"75","CreatedAt":"2025-09-23T18:00:24.201Z"}
- Verify with regex operator:
- Complete MongoDB Query Manipulation: Successfully bypassed all query filters using MongoDB operators
- Sensitive Data Extracted: Coupon code TRAC075 with value $75
- Multiple Injection Vectors Confirmed: regex, and $gt operators all successful
- Business Logic Bypass: Access arbitrary coupons without knowing valid codes
coupon_code parameter and passes them directly to MongoDB queries, allowing operator injection.
SSRF-VULN-01: Critical SSRF via Contact Mechanic Endpoint
Severity: CriticalLocation:
/workshop/api/merchant/contact_mechanic endpointImpact: Complete internal network access with credential theft capabilities Prerequisites: Valid JWT authentication token Exploitation:
- Test SSRF by forwarding request to external webhook:
- Observe external request with forwarded Authorization header:
- Server makes POST requests to attacker-controlled URLs
- Authorization headers forwarded to external services (critical credential theft)
- Retry mechanism (
repeat_request_if_failed) enables persistent attacks - Complete control over HTTP method, headers, and body
- Access to internal services and cloud metadata endpoints
mechanic_api parameter accepts arbitrary URLs and the server makes requests to those URLs with internal authentication credentials. The repeat_request_if_failed parameter can be used for brute force attacks or persistent exploitation.
XSS Defense Validation
Shannon correctly identified that the application has robust XSS defenses:- Input validation blocks malicious payloads
- Framework-level protections (React, Django) prevent injection
- Proper output encoding applied consistently
Report Access
View the complete penetration test report with all vulnerability details: View Full Report →Application Details
OWASP crAPI (Completely Ridiculous API) is a modern intentionally vulnerable API application from OWASP designed to benchmark security tools against the OWASP API Security Top 10.- GitHub: OWASP/crAPI
- Purpose: API security testing and training
- Technology: Java Spring Boot, Python Flask, React, PostgreSQL, MongoDB
- Focus: OWASP API Security Top 10 vulnerabilities
Key Takeaways
Shannon’s performance on crAPI demonstrates:- Advanced Authentication Testing: Successfully exploited multiple JWT attack vectors including algorithm confusion, alg:none, JKU header SSRF, and KID header injection
- Multi-Database Coverage: Exploited both SQL (PostgreSQL) and NoSQL (MongoDB) injection vulnerabilities
- Critical SSRF Discovery: Found SSRF with credential theft capability through contact mechanic endpoint
- Zero False Positives: Correctly identified robust XSS defenses without false reports
- Complete Database Compromise: Extracted user credentials and system information through injection attacks
Next Steps
- View OWASP Juice Shop Report: Web application vulnerability coverage
- View ctal API Report: API security testing including command injection
- View Benchmark Results: Quantitative performance analysis
- Get Started with Shannon: Test your own applications
