go package report

Is github.com/mhsanaei/3x-ui/v2 safe?

1 known vulnerability, worst severity HIGH.

// reach

0 direct dependencies

none carry a known advisory

    0 packages depend on it

    an advisory here reaches each of them

      Create a free accountfor every dependency path, dependent and what to upgrade
      // ai model usage

      Tracked for PyPI packages. HuggingFace models declare Python dependencies, so go packages are not covered.


      cvss
      0.0
      high

      severity out of 10

      epss
      0.00%
      medium

      chance of exploitation in 30 days, 47th percentile of all CVEs

      xyz score
      not scored

      CyberXYZ composite out of 10

      fig. 01 — GHSA-jm48-m3rr-9hgg, the advisory selected below

      // 1 advisories

      GHSA-jm48-m3rr-9hgg

      HIGHCVE-2026-55477
      // 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.

      // poc
      • Authenticate as a panel administrator.
      • Export the panel database.
      • Modify xrayTemplateConfig.log.access to point to a writable target file (e.g. ~/.ssh/authorizedkeys).
      • Inject an attacker-controlled SSH public key into an inbound client's email field.
      • 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.

      // 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.

      // patches

      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/authorizedkeys) 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.

      // 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.

      // cvss v3.1 vector

      CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H

      Attack vector
      Network
      Attack complexity
      Low
      Privileges required
      High
      User interaction
      None
      Scope
      Unchanged
      Confidentiality
      High
      Integrity
      High
      Availability
      High

      Checked 2026-09-26 at 01:02 UTC. The most recent advisory here was published 2026-08-24. Updated continuously from NVD, GHSA, OSV and CNA feeds.

      Think a verdict here is wrong? Tell us — we respond within 2 business days.