Summary
3X-UI Vulnerable to Authenticated Arbitrary File Write via Database Import and Xray Log Path Manipulation
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.
PoC
- Authenticate as a panel administrator.
- Export the panel database.
- Modify
xrayTemplateConfig.log.accessto point to a writable target file (e.g.~/.ssh/authorized_keys). - Inject an attacker-controlled SSH public key into an inbound client's
emailfield. - Import the modified database.
- Trigger a connection through the modified inbound.
- Xray writes the attacker-controlled content to the specified file, allowing SSH access as the user running Xray.
A complete PoC is available and can be provided privately.
Workarounds
None other than upgrading. Until you can update to v3.3.1, restrict panel administrator access to fully trusted operators.
Notes
The underlying issue is the unrestricted log path rather than the database import alone: an administrator can set the same xrayTemplateConfig.log.access / log.error value directly through the built-in raw Xray configuration editor, which is why the fix hardens the value at configuration-generation time to cover every vector. 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.
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. This 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.
The application does not adequately validate input before processing it, allowing unexpected values to reach sensitive code paths. Typical impact: varies by context: data corruption, logic bypass, or denial of service.
CVE-2026-55477 has a CVSS score of 7.2 (High). The vector is network-reachable, high privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (3.3.1); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Fixed in v3.3.1.
resolveXrayLogPaths (internal/web/service/xray.go) now 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.
Frequently Asked Questions
- What is CVE-2026-55477? CVE-2026-55477 is a high-severity improper input validation vulnerability in github.com/mhsanaei/3x-ui/v3 (go), affecting versions <= 3.3.0. It is fixed in 3.3.1. The application does not adequately validate input before processing it, allowing unexpected values to reach sensitive code paths.
- How severe is CVE-2026-55477? CVE-2026-55477 has a CVSS score of 7.2 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which packages are affected by CVE-2026-55477?
github.com/mhsanaei/3x-ui/v3(go) (versions <= 3.3.0)github.com/mhsanaei/3x-ui/v2(go) (versions <= 2.9.4)
- Is there a fix for CVE-2026-55477? Yes. CVE-2026-55477 is fixed in 3.3.1. Upgrade to this version or later.
- Is CVE-2026-55477 exploitable, and should I be worried? Whether CVE-2026-55477 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-55477 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-55477? Upgrade
github.com/mhsanaei/3x-ui/v3to 3.3.1 or later.