Skip to content

url encoded ipv6 SS-URI link cause shadowsocks-android crash 生成的二维码/URI导致 shadowsocks-android 崩溃 #1758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zmz125000 opened this issue Mar 19, 2018 · 15 comments
Labels

Comments

@zmz125000
Copy link

zmz125000 commented Mar 19, 2018

Please answer these questions before submitting your issue. Thanks! / 请按照以下格式描述你的问题

Version(release version or AppVeyor link) / 版本(正式版或基于AppVeyor的链接)

Shadowsocks-4.0.9

Environment(Operating system, .NET Framework, etc) / 操作环境(操作系统,.NET Framework等)

Steps you have tried / 操作步骤

注:用了 simple-obfs 才会这样
on shadowsocks-windows share ipv6 server config and scan qrcode using shadowsocks-android

What did you expect to see? / 期望的结果

ss://[method&password]@[fdc3:90ba:caaa:4e91::]:443

What did you see instead? / 实际结果

shadowsocks-android crash
ss://[method&password]@fdc3%3a90ba%3acaaa%3a4e91%3a%3a:443

Config and error log in detail (with all sensitive info masked) / 配置文件和日志文件(请隐去敏感信息)

@chenshaoju
Copy link
Collaborator

你好,我使用 4.5.0 版本的 Shadowsocks for Android 扫了一下Shadowsocks for Windows生成的二维码,没有问题。这是一个无效服务器,使用IPv6地址,你可以测试一下:
image

你是不是用了simple_obfs或者ktcp这种插件?

@zmz125000
Copy link
Author

@chenshaoju 对, 用了 simple-obfs 才会这样。

@zmz125000 zmz125000 changed the title url encoded ipv6 SS-URI link cause shadowsocks-android crash 生成的二维码导致 shadowsocks-android 崩溃 url encoded ipv6 SS-URI link cause shadowsocks-android crash 生成的二维码/URI导致 shadowsocks-android 崩溃 Mar 19, 2018
@chenshaoju
Copy link
Collaborator

此问题可能需要跨项目协调,请等待开发人员处理。

@celeron533
Copy link
Contributor

Reproduced the issue after enable the plug-in with ipv6

@celeron533
Copy link
Contributor

celeron533 commented Mar 20, 2018

@zmz125000
Copy link
Author

@celeron533
ss://[method&password]@[fdc3:90ba:caaa:4e91::]:443
IP 要加方括号

@celeron533
Copy link
Contributor

celeron533 commented Mar 23, 2018

@zmz125000

这个问题其实我也注意到了,但由于目前的老版本(非SIP002,SIP003)都没有加方括号,考虑到其他平台的兼容性,暂时不做处理

https://tools.ietf.org/html/rfc5952

6.  Notes on Combining IPv6 Addresses with Port Numbers
   There are many different ways to combine IPv6 addresses and port
   numbers that are represented in text.  Examples are shown below.
   o  [2001:db8::1]:80
   o  2001:db8::1:80
   o  2001:db8::1.80
   o  2001:db8::1 port 80
   o  2001:db8::1p80
   o  2001:db8::1#80
The situation is not much different in IPv4, but the most ambiguous
   case with IPv6 is the second bullet.  This is due to the "::"usage in
   IPv6 addresses.  This style is NOT RECOMMENDED because of its
   ambiguity.  The [] style as expressed in [RFC3986] SHOULD be
   employed, and is the default unless otherwise specified.  Other
   styles are acceptable when there is exactly one style for the given
   context and cross-platform portability does not become an issue.  For
   URIs containing IPv6 address literals, [RFC3986] MUST be followed, as
   well as the rules defined in this document.

The [] style as expressed in [RFC3986] SHOULD be
employed, and is the default unless otherwise specified.

https://tools.ietf.org/html/rfc3986
Appendix A. Collected ABNF for URI

IP-literal    = "[" ( IPv6address / IPvFuture  ) "]"

@zmz125000
Copy link
Author

@celeron533
不加括号 shadowsocks-android 会崩溃,看来要到那边开 issue

@celeron533 celeron533 reopened this Mar 23, 2018
@celeron533
Copy link
Contributor

不加括号 shadowsocks-android 会崩溃

RFC里建议v6地址加括号
桌面客户端这边需要再看看做这个改动会不会影响到其他程序的读取

不过android读没括号的已经崩了~

@celeron533
Copy link
Contributor

celeron533 commented Mar 23, 2018

Android版生成的QR是带方括号的
ss://YWVzLTI1Ni1jZmI6c2RzZGZzZGY@[fe80::1111:1111:1111:1111]:8388#local%2Bv6

看来还是这边加上方括号比较妥当

@celeron533
Copy link
Contributor

celeron533 commented Mar 23, 2018

Please try this build @zmz125000 .
Added square brackets for SIP002 server address.
https://ci.appveyor.com/project/celeron533/shadowsocks-windows-3j4p4/build/job/ng54kq03d79uccj3/artifacts

@zmz125000
Copy link
Author

@celeron533 Testing passed

@celeron533
Copy link
Contributor

celeron533 commented Mar 23, 2018

@zmz125000 有空的话麻烦请看看IPv4和域名的识别情况,谢谢

@madeye
Copy link
Contributor

madeye commented Mar 26, 2018

It's been fixed via shadowsocks/shadowsocks-android@c64e15a

@celeron533
Copy link
Contributor

Thanks @madeye ! I've also added brackets for SIP002 SIP003 server share protocol in Windows version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants