fix: patch multiple zero-day security vulnerabilities#1026
Open
fix: patch multiple zero-day security vulnerabilities#1026
Conversation
- Token verify: always validate username+token pair before setting cookie to prevent session confusion via mismatched credentials (CVE-class: broken authentication) - Registration: reserve admin username 'ryo' and system names to prevent admin privilege squatting; improve error message to reduce user enumeration - Songs clear-cached-data: require authentication and canModifySong check to prevent unauthenticated data destruction (CVE-class: broken access control) - Chat systemState: strip __proto__/constructor/prototype keys from client-supplied objects to prevent prototype pollution - Room listing (legacy handler): use authenticated username instead of unauthenticated query param for private room visibility (IDOR fix) - Room creation: validate member usernames with assertValidUsername - Bulk messages (legacy handler): add private room membership check - Share applet: add max content size (512KB) and field length limits to prevent DoS via unbounded payloads - Password set: disallow grace-period tokens for password changes - CORS: add warning log for wildcard origin config; document that reflect-origin mode is used (never literal '*' with credentials) - SSRF: add double-DNS-resolution defense against DNS rebinding attacks; re-validate resolved addresses before connecting - Songs bulk import: cap array at 500 items; add 5MB decompression limit to prevent zip bomb DoS Co-authored-by: Ryo Lu <me@ryo.lu>
|
The preview deployment for ryos-dev is ready. 🟢 Open Preview | Open Build Logs | Open Application Logs Last updated at: 2026-03-30 08:07:39 CET |
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.
Security Audit & Fixes
Full security audit of the API surface uncovered 12 vulnerabilities across authentication, authorization, input validation, and network-layer protections. This PR fixes all of them.
Critical Fixes
body.usernamewithoutbody.token, bypassing validationapi/auth/token/verify.tsclear-cached-dataaction on songs deletes translations/furigana/soramimi without any auth checkapi/songs/[id].tscanModifySongpermission checkryo(hardcoded admin) could be registered by any user on a fresh deploymentapi/auth/register.tsryo,admin,system,moderator,modfrom public registrationhandleGetRoomstrusts unauthenticated?username=query param to filter private roomsapi/rooms/_helpers/_rooms.tsMedium Fixes
systemStatespread with...can inject__proto__/constructorkeysapi/chat.tshandleGetBulkMessagesskips private room membership checkapi/rooms/_helpers/_messages.tsallowExpiredAuth: truelets stolen grace tokens set new passwordsapi/auth/password/set.tsallowExpiredAuth: falsecontentfield enables Redis memory DoSapi/share-applet.tsapi/songs/index.tssongsarray sizeapi/songs/index.tsLow / Hardening Fixes
api/_utils/_ssrf.tsAPI_ALLOWED_ORIGINS=*with credentials is insecureapi/_utils/_cors.ts*)api/auth/register.tsapi/rooms/index.tsassertValidUsernameTesting
bun run build— clean compilationbun run test:unit— all 130 tests pass (0 failures)