Skip to content

fix: harden hysteria auth boundaries#97

Open
smileoniks-ctrl wants to merge 2 commits into
ClickDevTech:devfrom
smileoniks-ctrl:main
Open

fix: harden hysteria auth boundaries#97
smileoniks-ctrl wants to merge 2 commits into
ClickDevTech:devfrom
smileoniks-ctrl:main

Conversation

@smileoniks-ctrl

Copy link
Copy Markdown
Contributor

Summary

This PR hardens the public Hysteria authentication and subscription boundaries.

  • Rejects malformed /api/auth payloads unless auth is exactly userId:password with both parts non-empty.
  • Always validates the supplied password against the generated Hysteria password first, then the legacy DB password fallback.
  • Removes public userId fallback from /api/files/:token and /api/info/:token; only subscriptionToken is accepted.
  • Removes panel UI and wizard fallbacks that generated subscription links with userId.
  • Adds startup backfill for existing users without subscriptionToken.
  • Adds a dedicated /api/auth rate limiter using rateLimit.authPerSecond.

Why

Previously, strict auth could be bypassed by sending a bare userId or malformed auth payload. Public subscription endpoints also accepted userId as a token fallback, exposing predictable subscription URLs.

Compatibility

Generated Hysteria links still use:

hysteria2://userId:password@...

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