fix(security): restrict subscription page access to /{uuid}/sub, fix multi-user rendering & inject vars into wrangler.toml in CI #5
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.
Description
This PR addresses a security vulnerability and a logical bug in the subscription page handling:
/subendpoint. The subscription page now requires the UUID in the URL path (e.g.,/${uuid}/sub) to prevent unauthorized access to sensitive configuration details (Information Disclosure).src/pages/index.tsto render the specific configuration matching the UUID in the request URL. Previously, the UI hardcoded to always display the first UUID in the environment variable, ignoring other users.subscriptionPageTextMakerfor better readability.Related Issue
Fixes security vulnerability where
/subexposed credentials without authentication.Also fixes the issue where multi-UUID setups only displayed the first user's config.
Motivation and Context
Security Risk: The previous
/subendpoint allowed anyone knowing the domain to view the VLESS UUID and connection details, bypassing the proxy's authentication. By enforcing/${uuid}/sub, the UUID acts as a pre-shared key for access.Bug: For users employing multiple UUIDs (e.g.,
UUID=id1,id2), accessing the subscription page previously would always show the config forid1, even if the intended user wasid2. This PR ensuresid2sees their own config.Align Document & Deploy Behavior: According to README.md and wrangler.toml it might should be able to sync repository variables for PROXY_IP/UUID to Cloudflare Worker Pages instance in PLAINTEXT for section Variables and Secrets when deploy in Method 3: GitHub Actions
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: