GHSA-jm48-m3rr-9hgg: Input Validation

Published Aug 24, 2026
·
Updated

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

1. Authenticate as a panel administrator. 2. Export the panel database. 3. Modify xrayTemplateConfig.log.access to point to a writable target file (e.g. ~/.ssh/authorizedkeys). 4. Inject an attacker-controlled SSH public key into an inbound client's email field. 5. Import the modified database. 6. Trigger a connection through the modified inbound. 7. 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.

Affected Software

2 affected componentsFixes available
go/github.com/mhsanaei/3x-ui/v2<=2.9.4
go/github.com/mhsanaei/3x-ui/v3<=3.3.0
3.3.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/mhsanaei/3x-ui/v3 to a version that resolves this vulnerability.

    Fixed in 3.3.1
  2. Upgrade

    Upgrade v3.3.1 to a version that resolves this vulnerability.

    Fixed in v3.3.1
  3. Compensating control

    Until you can update to v3.3.1, restrict panel administrator access to fully trusted operators.

Event History

Aug 24, 2026
Advisory Published
via GitHub·09:05 PM
Data Sourced
via GitHub·09:05 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Who can exploit this issue?

An authenticated panel administrator can exploit it. The attacker must be able to export the SQLite database and import a modified copy back into the panel.

2

What additional action is required after importing the modified database?

The attacker must cause an inbound client connection to be processed with controlled content in that client's email field. Xray then writes that controlled content to the attacker-selected access log path.

3

What level of host access could result?

Files are written as the user running Xray. If Xray runs as root, the issue can be leveraged for code execution and persistent access as root; otherwise, impact is limited to the privileges of the Xray service account.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203