mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #4781] [Bug]: WARP outbound generated without Cloudflare reserved bytes #3318
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#3318
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @deepru on GitHub (Jun 1, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4781
Describe the bug
When creating a WARP outbound from a clean 3x-ui installation, the generated Xray WireGuard outbound is saved with an empty
settings.reservedarray and no peer reserved value:For Cloudflare WARP, the generated profile normally includes 3 reserved bytes / client id. Xray WireGuard outbound supports the
reservedfield, and WARP profiles generated by other tools usually provide 3 decimal reserved bytes.The outbound may still appear to work in some cases, but the generated Cloudflare WARP profile looks incomplete.
How to reproduce the problem
install.shscript.Xray Settings->Outbounds.WARP/Create.Add outbound.xrayTemplateConfigin the SQLite database.Safe diagnostic command, without printing private keys:
Expected behavior
For a Cloudflare WARP outbound, the generated WireGuard settings should include valid reserved bytes, for example:
The exact values must come from the generated WARP registration/profile and should not be hardcoded.
Actual behavior
On a clean 3x-ui installation, after creating WARP from the panel, the saved outbound is:
So the WARP outbound is created without Cloudflare reserved bytes.
Relevant logs
Screenshots
Not needed. The sanitized SQLite/Xray template output above is enough to reproduce the issue.
3x-ui version
3.2.5
Xray-core version
26.6.1
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 24.04 / Debian 12
Which parts of the panel are affected?
Xray config generation
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
No — direct access
Before submitting
@github-actions[bot] commented on GitHub (Jun 1, 2026):
Thanks for the detailed and well-reproduced report!
This is a confirmed bug in the backend. The root cause is in
web/service/warp.go— theRegWarpfunction extractsid,token, andaccount.licensefrom the Cloudflare registration response, but does not extractclient_id(which lives atconfig.client_idin the response). As a result, theclient_idis never stored in the database.On the frontend side (
WarpModal.tsx), the logic is actually correct:reservedFor(data?.client_id)decodes the base64client_idinto 3 decimal bytes and passes them asreserved. But sinceclient_idis never populated in the storedwarpData, the value is alwaysundefined, andreservedForreturns[].Fix needed in
web/service/warp.go→RegWarp:Extract
client_idfrom the registration response (path:rsp["config"].(map[string]any)["client_id"]) and include it in thewarpDatamap before saving to the database. The same fix should also be applied toGetWarpConfigso that fetching an existing registration also returns theclient_id.Workaround (manual): You can patch the reserved bytes directly in the SQLite database or via the panel's outbound editor after identifying your
client_idfrom the Cloudflare API response. Other WARP tooling (e.g.,warp-reg) can generate a fresh registration that includes theclient_id.A pull request fixing
warp.goto persist and returnclient_idwould be very welcome here.@deepru commented on GitHub (Jun 1, 2026):
Thanks for confirming and for the clear root-cause explanation.
That matches what I observed: the frontend-side
reservedFor(data?.client_id)logic makes sense, but the saved/generated WARP data does not containclient_id, so the resulting reserved bytes become an empty array.I will avoid manually patching generated reserved bytes in my tooling and will just preserve them when present / warn when missing until upstream persists and returns
client_idcorrectly.Thanks again.
@MHSanaei commented on GitHub (Jun 1, 2026):
Fixed.
RegWarpnow persistsconfig.client_idfrom the Cloudflare registration response, andWarpModalsources the reserved bytes from the live config response (config.client_id) with a fallback to the stored credentials. This heals both new and already-registered installs without re-registration, so the generated WARP outbound now includes the correct 3 reserved bytes instead of[].