Accept plaintext SS userinfo emitted by Sub-Store#51
Closed
enximi wants to merge 1 commit into
Closed
Conversation
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.
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. |
Author
|
Closing as superseded by #50. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
explodeSS()currently assumes that the userinfo before@is alwaysURL-safe base64 when parsing links in the
ss://...@server:portform.Accepted today:
Example shape:
But Sub-Store can also emit a different shape where the userinfo is
plaintext and URL-encoded instead of base64-encoded:
Example shape:
Because the parser only tries
urlSafeBase64Decode(secret)in this codepath, 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:passwordfrom the SS userinfo.This preserves current behavior for existing inputs while accepting the
Sub-Store output shape above.
Verification