[Feature Request] Enhance finalmask (or add AWG 3.1 support) to allow packet payload padding and random trailers for clean WireGuard / WARP outbounds
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 38/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- go
- Domain
- networking
Research direction
Start by locating the existing finalmask implementation and WireGuard outbound module in Xray-core; the issue names no specific files or tests. Compare current standalone noise behavior with the requested handshake padding/trailers and AWG 3.1 parameters. Done means one agreed approach is implemented and validated for the stated Cloudflare WARP/BoringTun behavior.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
Currently, using Xray-core as a client to route traffic through pure WireGuard / Cloudflare WARP endpoints in censorship-heavy environments (like Russia) is becoming increasingly unreliable.
In previous discussions, when asked about incorporating AmneziaWG (AWG 2.0) features, the core team reasonably pointed out that finalmask covers these needs by sending pre-handshake noise (noise array).
However, censorship filters (DPI/TSPU) have evolved. While finalmask is great for generating noise packets before the handshake, it cannot modify the payload size/structure of the actual Handshake packet itself.
With the release of AmneziaWG 3.0 / 3.1, several new evasion mechanisms were introduced. Some of these—specifically RandomTrailers (appending random padding to the end of the handshake packet) and Content Padding—happen to work one-way against user-space WireGuard implementations like Cloudflare WARP (e.g. BoringTun strips trailing unknown bytes after parsing the 148-byte Noise IK payload).
Because finalmask currently only sends standalone UDP noise packets prior to the main payload, it is mathematically impossible to achieve packet-level padding/trailers with the existing finalmask implementation.
Describe the solution you'd like
We kindly request one of the following approaches:
-
Extend
finalmaskcapability:- Add a feature inside
finalmask(or a new mask type likepadding/trailer) that allows appending random/custom padding bytes directly to the outgoing WireGuard Handshake UDP datagram, rather than sending them as separate UDP packets.
- Add a feature inside
-
Native AmneziaWG 3.1 Outbound Support:
- Alternatively, add native support for AWG 3.1 parameters in the WireGuard outbound module (e.g.
Jc,Jmin,Jmax,S1-S4,RandomTrailers,DisableCookies, CPS syntax), allowing users to fine-tune both two-way and one-way obfuscation settings.
- Alternatively, add native support for AWG 3.1 parameters in the WireGuard outbound module (e.g.
Describe alternatives you've considered
- Using
finalmasknoise arrays: Only sends separate pre-packets. DPI now easily correlates standalone pre-noise followed by an unpadded 148-byte WG handshake packet and drops the connection. - Running external
awg-go/amneziawgprocesses and routing Xray through local TUN devices: Works, but adds significant setup complexity, memory overhead, and resource usage compared to having this capability directly in Xray-core outbounds.
Additional context
Cloudflare WARP and many pure WireGuard deployments remain a vital gateway for free internet access in restricted regions. Having the ability to pad the handshake packet or attach random trailers natively within Xray-core would greatly improve connection stability for thousands of users without requiring full two-way protocol changes on the remote server side.
Thank you for your incredible work on Xray-core!
- Dominant language
- Go
- Stars
- 43.3k
- Forks
- 6.2k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 55
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from XTLS/Xray-core
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:other issue-rating: 🦞 diamond lobster no-stale P2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openclaw/crabbox#3249 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
ec2-subnet, security-group and internet-gateway skip all resources when one is deleted during the scanPossibly taken @toabctl claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
gruntwork-io/cloud-nuke#1208 ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
snowflakedb/gosnowflake#1872 ·
-
MCP `shadow` says `out` is a folder, but for TS, Python, C, Go and Ruby it is the module's fileOpengood first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
erkamyaman/rust-anything#1328 ·
Maintainers usually reply within 1 day