3X-UI, Authenticated Arbitrary File Write, CVE-2026-55477 (High) -DC-Aug2026-1849

Listen to this Post

Summary

An authenticated administrator can abuse the database import functionality to achieve arbitrary file write on the host by modifying Xray configuration values stored in the database. This can be leveraged to obtain code execution and persistent access as the user running Xray (including root when Xray is running as root).

Details

The database import functionality trusts attacker-controlled configuration values without sufficient validation. An authenticated administrator can export the SQLite database, modify `xrayTemplateConfig.log.access` to point to an arbitrary file, and import the modified database back into the panel.
The attacker can then inject controlled content into an inbound client’s `email` field. When a connection is processed, Xray writes the attacker-controlled content to the configured access log path. Because the log path is fully attacker-controlled, this behavior results in arbitrary file write as the user running Xray.
Depending on the target file and service privileges, this can be used to obtain code execution and persistent host access. In environments where Xray runs as root, successful exploitation results in persistent root access.
The vulnerability is classified as CWE-73 (External Control of File Name or Path) and carries a CVSS score of 7.2 (High). Exploitation requires that the attacker already has admin authentication to the 3X-UI interface.
The fix implemented in version 3.3.1 addresses this vulnerability through enhanced input validation and proper sanitization of database import operations. The patch introduces `resolveXrayLogPaths` (internal/web/service/xray.go) which confines the Xray `log.access` and `log.error` paths to the panel’s log folder.
Any configured value is reduced to its base filename under config.GetLogFolder(). Absolute paths (such as `/etc/cron.d/…` or ~/.ssh/authorized_keys) and `..` traversal can no longer make Xray write outside the log folder, while `””` and `”none”` continue to disable logging. The confinement is applied during Xray configuration generation, so it covers every way the template can be set — the database import and the built-in raw Xray configuration editor alike.
The client `email` field is also independently validated (control characters, spaces, and slashes are rejected), which constrains what can be written into a log line. The reliable primitive is therefore arbitrary file write (creation, append, or corruption) at an attacker-chosen path, with code execution dependent on a suitable writable target and the privileges of the Xray process.

DailyCVE Form:

Platform: 3X-UI
Version: < 3.3.1
Vulnerability: Arbitrary File Write
Severity: High (CVSS 7.2)
Date: 2026-06-25

Prediction: Patch already available

What Undercode Say:

Check current 3X-UI version
x-ui -v
Check if vulnerable version is running
Versions prior to 3.3.1 are affected
Check Xray process privileges
ps aux | grep xray
Check current log path configuration in database
sqlite3 /etc/x-ui/x-ui.db "SELECT value FROM configs WHERE key='xrayTemplateConfig.log.access';"
Backup database before any operations
cp /etc/x-ui/x-ui.db /etc/x-ui/x-ui.db.backup
Upgrade to patched version 3.3.1
bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) v3.3.1

Exploit: (Educational Purposes!)

1. Authenticate as panel administrator (web interface or API)
2. Export the SQLite database
sqlite3 /etc/x-ui/x-ui.db ".dump" > x-ui-backup.sql
3. Modify xrayTemplateConfig.log.access to point to SSH authorized_keys
sqlite3 /etc/x-ui/x-ui.db "UPDATE configs SET value='~/.ssh/authorized_keys' WHERE key='xrayTemplateConfig.log.access';"
4. Inject attacker-controlled SSH public key into inbound client email field
(This step is performed via web interface or API by updating an inbound client's email)
5. Import the modified database back into the panel
(Database import is triggered via web interface)
6. Trigger a connection through the modified inbound
(Connect to the Xray inbound service)
7. Xray writes the attacker-controlled SSH public key to ~/.ssh/authorized_keys
Result: SSH access as the user running Xray

Protection:

  • Upgrade to 3X-UI version 3.3.1 or later immediately
  • Until upgrade is possible, restrict panel administrator access to fully trusted operators only
  • Run Xray processes under a non-root user to limit damage in case of successful exploitation
  • Monitor log files for unusual path configurations or unexpected file writes
  • Consider implementing additional network segmentation for management interfaces

Impact:

  • Type: Authenticated Arbitrary File Write → Privilege Escalation / Code Execution
  • Any authenticated 3X-UI administrator can write attacker-controlled content to arbitrary files accessible by the Xray process
  • Allows compromise of the account running Xray and may lead to full host compromise depending on deployment configuration and service privileges
  • In environments where Xray runs as root, successful exploitation results in persistent root access
  • Attack can be performed from the web control panel, making it a network-based threat that requires no external service
  • Once exploited, the attacker can maintain persistence until system changes occur

🎯Let’s Practice Exploiting & Learn Patching For Free:

🎓 Live Courses & Certifications:

Join Undercode Academy for Verified Certifications

🚀 Request a Custom Project:

Secure, high-velocity infrastructure and disruptive technological engineering. Contact our engineering team for high-tier development and proprietary systems:
[email protected]
💎 Smart Architecture | 🛡️ Secure by Design | ⭐ Trusted by Thousands

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top