Proposed fix
Verify that the report belongs to the requester’s workspace before returning it.
Resolve the workspace from the authenticated caller’s membership, require report read permission, and query by both workspace ID and report ID.
See the suggested query
const workspace = requireWorkspacePermission(
session,
"reports:read"
);
const report = await reports.findOne({
id: reportId,
workspaceId: workspace.id
});
if (!report) return notFound();