server: ensure only own notifications can be marked as read

Exploiting this before should already have been rather difficult because you
would need to know or guess the notification's ID. It is also of relatively
low security impact.

Changelog: Fixed
This commit is contained in:
syuilo 2022-09-06 20:54:49 +09:00 committed by Johann150
parent c926b4fbcc
commit 4b3cf7834b
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -13,6 +13,7 @@ export async function readNotification(
// Update documents
const result = await Notifications.update({
notifieeId: userId,
id: In(notificationIds),
isRead: false,
}, {