mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5432] [Bug]: Shadowsocks2022 link: userinfo must not be base64 encoded #3797
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#3797
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 @taxi-c on GitHub (Jun 18, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5432
Describe the bug
When i get the link in the user panel just for the SS2022 inbound (2022-blake3-aes-128-gcm or 2022-blake3-aes-256-gcm), the userinfo is base64 encoded: userinfo = method+server password:client password.
for example Hiddify cleint could not read it without error. the method is none!
https://shadowsocks.org/doc/sip002.html
Note that encoding userinfo with Base64URL is recommended but optional for Stream and AEAD (SIP004). But for AEAD-2022 (SIP022), userinfo MUST NOT be encoded with Base64URL. When userinfo is not encoded, method and password MUST be percent encoded.
How to reproduce the problem
1.Create an inbound shaadowsocks : (2022-blake3-aes-128-gcm or 2022-blake3-aes-256-gcm)
2.Create a client which will use it.
3.Get the link, not the suscription link, but the link just for the inbound
4. You will have something like ss:// MjAyMi.......
5.
Expected behavior
cc2022-blake3-aes-256-gcm:YctPZ6U7xPPcU%2Bgp3u%2B0tx%2FtRizJN9K8y%2BuKlW2qjlI%3D@192.168.100.1:8888#Example3)
Actual behavior
Get a link like ss://MjAyMi.......
Relevant logs
Screenshots
No response
3x-ui version
3.3.1
Xray-core version
26.6.1
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 24.04
Which parts of the panel are affected?
No response
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
None
Before submitting
@github-actions[bot] commented on GitHub (Jun 18, 2026):
The report is confirmed.
genShadowsocksLinkininternal/sub/service.go(lines 719–742) appliesbase64.RawURLEncoding.EncodeToStringto the entire userinfo string for all Shadowsocks ciphers, including2022-blake3-aes-128-gcmand2022-blake3-aes-256-gcm:SIP002 (AEAD ciphers) permits optional Base64URL encoding of userinfo. SIP022 (AEAD-2022 ciphers) explicitly forbids it: userinfo MUST NOT be Base64URL-encoded; instead each component (method and password) MUST be percent-encoded individually. The correct link shape for an SS2022 inbound is:
where each segment is percent-encoded (e.g.
=→%3D,/→%2F).The
encodeUserinfohelper already present in the same file (line 667) does exactly that encoding and is used for Trojan and Hysteria2 links; it is simply not applied to the SS2022 path.The fix requires the
method[0] == '2'branch to build the userinfo as percent-encoded individual components instead of a single base64 blob — both for the direct link (line 742) and for theexternalProxypath (line 734). The characterization testTestChar_C3_ShadowsocksExternalProxyininternal/sub/characterization_test.go(line 171) locks in the current (incorrect) base64 output and will need to be updated alongside the fix.For context: issue #123 (closed, 2023) introduced base64 encoding for SS links to satisfy clients that expected the legacy format. That change covered all ciphers uniformly but predates the SIP022 constraint being enforced by newer clients such as Hiddify.
This reply was generated automatically; a maintainer may follow up.