/

CVE-2026-55477

Severity:

HIGH RISK

(7.2)

Arbitrary File Write (CWE-73) via 3X-UI DB Import Abuse

CVE-2026-55477

Deferred

Vulnerability type

Category:

Arbitrary File Write

CWE:

CWE-73

Impact:

Arbitrary File Write Leading to Code Execution

Severity:

HIGH RISK

(7.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

An arbitrary file write vulnerability in the 3X-UI web control panel allows an authenticated administrator to abuse the database import feature to overwrite files on the host via manipulated Xray configuration values.

When Xray is running with elevated privileges, this condition can be used to obtain code execution and persistent access as the Xray process user, potentially including root.

Affected context

The issue arises in deployments using the 3X-UI web control panel to manage Xray-core servers where database import functionality is available to administrative users.

Risk is present when Xray configuration values stored in the database are applied directly to the filesystem without robust validation or path controls.

Impact increases significantly in environments where Xray runs with high privileges or has write access to sensitive application or system directories.

Exploit preconditions

  • Attack surface: 3X-UI web interface, specifically the database import functionality
  • Required access: Authenticated administrator or any role capable of triggering database imports and modifying Xray configuration values
  • Trigger point: Importing a crafted database snapshot or configuration set that results in unsafe file writes when Xray configuration is applied
  • Why exploitation is possible: File paths and configuration-derived write locations are taken from database content without sufficient validation, allowing attacker-controlled paths or content to be written to arbitrary locations on the host

Why this happens

The root cause is insecure handling of filesystem paths and write operations derived from configuration data stored in the database.

3X-UI trusts configuration values imported from the database and uses them to drive file writes for Xray without enforcing strict path constraints, whitelisting, or isolation.

This corresponds to CWE-73: External Control of File Name or Path, where external inputs control the location and nature of file operations, enabling attackers to target arbitrary files for overwrite or creation.

Potential impact

  • Arbitrary file creation or overwrite on the host accessible to the Xray process
  • Introduction of malicious configuration or script files leading to code execution
  • Persistent backdoors via modified startup scripts or service definitions
  • Escalation of privileges when Xray runs as root or has access to system directories
  • Disruption of service or denial of service by corrupting critical configuration or application files

General mitigation guidance

Effective mitigation focuses on constraining how configuration data influences filesystem operations and reducing trust in imported database content.

Recommended patterns include:

  • Enforcing strict whitelists of allowed configuration-controlled file paths and directories
  • Normalizing and validating all paths before performing file writes, rejecting relative or traversal constructs
  • Segregating configuration-generated files into dedicated, non-privileged directories with limited impact if compromised
  • Running Xray and associated management components with least-privilege service accounts instead of root
  • Implementing defense-in-depth checks so that database import routines validate configuration shape and reject unexpected file-related entries

How teams detect issues like this

Detection typically combines code-level review and runtime monitoring:

  • Static analysis or manual review to identify file operations whose paths are derived from database or configuration inputs without robust validation
  • Audit of the database import workflow to ensure no unbounded mapping from imported values to filesystem locations
  • Logging and monitoring of configuration changes and database imports, with alerts for unusual path values or writes to non-standard directories
  • Policy-based checks in CI/CD or pre-deployment reviews requiring explicit justification for configuration-driven file writes and verifying path constraints

Sources

SourceLink
github.comgithub.com/MHSanaei/3x-ui/security/advisories/GHSA-jm48-m3rr-9hgg

Frequently asked

questions

Exploitation is limited to authenticated administrators or roles with access to the database import feature, but in many deployments administrative access may be shared or exposed to multiple operators, increasing practical risk.

The attacker must be able to modify Xray configuration values stored in the database and trigger a database import through the 3X-UI panel. No direct shell access to the server is required once this web access is available.

Restrict configuration-driven file writes to a small set of predefined, validated directories and paths, enforce robust path validation, and separate imported configuration data from direct filesystem operations. Additionally, ensure the service runs with minimal privileges so that even if a file write occurs, its impact is constrained.

Treat all configuration and database content as untrusted input, validate and sanitize any values that influence file paths, use allowlists rather than flexible user-controlled locations, and adopt least-privilege execution for services. Incorporating secure coding reviews and static checks for externally controlled file operations can help catch such patterns early.

Find out what's already
exploitable in your codebase.