CVE-2025-50735

7.5 HIGH

📋 TL;DR

A directory traversal vulnerability in NextChat's WebDAV proxy allows attackers to access sensitive files outside the intended directory by exploiting improper path validation. This affects all NextChat deployments up to version 2.16.0, potentially exposing configuration files, credentials, or other sensitive data.

💻 Affected Systems

Products:
  • NextChat
Versions: through 2.16.0
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Affects both authenticated and anonymous WebDAV endpoints. WebDAV must be enabled, but this is a common configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise through exposure of configuration files containing database credentials, API keys, or other secrets, leading to data breach or further attacks.

🟠

Likely Case

Unauthorized access to sensitive files like configuration files, logs, or source code, potentially exposing credentials or system information.

🟢

If Mitigated

Limited impact with proper network segmentation and access controls, though file exposure risk remains.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires sending specially crafted WebDAV requests with directory traversal sequences (e.g., '../'). Public proof-of-concept available in references.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.16.1 or later

Vendor Advisory: https://github.com/ChatGPTNextWeb/NextChat/security/advisories

Restart Required: Yes

Instructions:

1. Update NextChat to version 2.16.1 or later. 2. Restart the NextChat service. 3. Verify the fix by testing WebDAV endpoints.

🔧 Temporary Workarounds

Disable WebDAV

all

Disable WebDAV functionality entirely if not required.

Modify NextChat configuration to disable WebDAV endpoints.

Network Access Control

linux

Restrict access to WebDAV endpoints using firewall rules or network segmentation.

iptables -A INPUT -p tcp --dport [webdav-port] -j DROP
Use cloud security groups to block external access.

🧯 If You Can't Patch

  • Implement strict network access controls to limit WebDAV endpoint exposure to trusted IPs only.
  • Deploy a web application firewall (WAF) with rules to block directory traversal patterns.

🔍 How to Verify

Check if Vulnerable:

Test WebDAV endpoints with traversal payloads (e.g., GET /webdav/../../etc/passwd) and check for unauthorized file access.

Check Version:

Check NextChat version in admin panel or via package.json: cat package.json | grep version

Verify Fix Applied:

After patching, retest with traversal payloads; requests should return 403/404 errors instead of file contents.

📡 Detection & Monitoring

Log Indicators:

  • WebDAV requests containing '../' or similar traversal patterns
  • Unusual file access patterns from WebDAV endpoints

Network Indicators:

  • HTTP requests to WebDAV paths with traversal sequences
  • Increased traffic to sensitive file paths

SIEM Query:

source="webdav.log" AND (uri="*../*" OR uri="*..\\*" OR status=200 AND uri="*/etc/*")

🔗 References

📤 Share & Export