Skip to content

Accept plaintext SS userinfo emitted by Sub-Store#51

Closed
enximi wants to merge 1 commit into
MetaCubeX:masterfrom
enximi:fix/sub-store-ss2022-plaintext-uri
Closed

Accept plaintext SS userinfo emitted by Sub-Store#51
enximi wants to merge 1 commit into
MetaCubeX:masterfrom
enximi:fix/sub-store-ss2022-plaintext-uri

Conversation

@enximi

@enximi enximi commented Apr 10, 2026

Copy link
Copy Markdown

Problem

explodeSS() currently assumes that the userinfo before @ is always
URL-safe base64 when parsing links in the ss://...@server:port form.

Accepted today:

ss://<base64(method:password)>@server:port#remark

Example shape:

ss://YWVzLTI1Ni1nY206YzJWamNtVjA@server.example.com:443#Node

But Sub-Store can also emit a different shape where the userinfo is
plaintext and URL-encoded instead of base64-encoded:

ss://<method>:<urlencoded password>@server:port#remark

Example shape:

ss://aes-256-gcm:c2VjcmV0JTNEJTNE@server.example.com:443#Node

Because the parser only tries urlSafeBase64Decode(secret) in this code
path, links in the plaintext-userinfo shape are rejected.

Change

Keep the existing base64 parsing path and add a fallback that parses
URL-decoded plaintext method:password from the SS userinfo.

This preserves current behavior for existing inputs while accepting the
Sub-Store output shape above.

Verification

  • Existing base64-userinfo SS links still work
  • Sub-Store-generated plaintext-userinfo SS links now work
  • Existing non-SS conversion behavior is unchanged

Subconverter currently accepts SS links where the userinfo before `@`
is URL-safe base64:

  ss://<base64(method:password)>@server:port#remark

Example shape:
  ss://YWVzLTI1Ni1nY206YzJWamNtVjA@server.example.com:443#Node

Sub-Store can also emit SS links where the userinfo is plaintext and
URL-encoded instead of base64-encoded:

  ss://<method>:<urlencoded password>@server:port#remark

Example shape:
  ss://aes-256-gcm:c2VjcmV0JTNEJTNE@server.example.com:443#Node

The previous parser only tried to base64-decode the userinfo when `@`
was present, so plaintext SS userinfo in this form was rejected.

Keep the existing base64 path and add a fallback that parses URL-decoded
plaintext `method:password` userinfo.
@enximi

enximi commented Apr 10, 2026

Copy link
Copy Markdown
Author

This PR fixes the same parsing gap as #50.

After comparing the two changes, #50 appears to cover the same root issue more completely, so I am closing this PR to avoid duplicate review and maintenance work.

Leaving this note here for traceability because this branch was produced from a real Sub-Store compatibility case on my side.

@enximi

enximi commented Apr 10, 2026

Copy link
Copy Markdown
Author

Closing as superseded by #50.

@enximi enximi closed this Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant