fix(share): stop exposing password hash and bypass token in share API (GHSA-833g-cqhp-h72j)
The share management endpoints serialized the storage struct directly, returning the bcrypt password_hash (crackable offline) and the bypass token for every share an authenticated caller could list, with admins seeing them for all users. Return a response DTO that exposes only whether a share is password-protected (hasPassword) and drops both secrets. The storage struct keeps its tags so the secrets stay persisted and the server-side auth/public flows are unchanged. Updates the frontend to use hasPassword and adds a regression test.
This commit is contained in:
4 files changed
+91
-7
No files matched your search
Vendored
+1
-1
@@ -25,7 +25,7 @@ interface Share {
|
||||
path: string;
|
||||
expire?: any;
|
||||
userID?: number;
|
||||
token?: string;
|
||||
hasPassword?: boolean;
|
||||
username?: string;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user