Skip to content
Medium 5.3

suggestions.mention returns the full workspace user and group directory to guests, bypassing the listUsers and listGroups policies (incomplete fix of fa2c49878)

GHSA-4x5j-6wvp-fc3m First seen on SecPulse

Summary

Summary

suggestions.mention queries User and Group directly and never consults listUsers or listGroups. Both of those policies exclude guests on purpose. A guest invited to a single document can page through every name, id and role in the workspace, and every mentionable group, and can...

Affected packages

PackageAffected → Fixed
otherOutline
< 1.10.0→ 1.10.0
Original description The description as published by the source.

Summary

suggestions.mention queries User and Group directly and never consults listUsers or listGroups. Both of those policies exclude guests on purpose. A guest invited to a single document can page through every name, id and role in the workspace, and every mentionable group, and can confirm whether a given email address belongs to a member.

For groups this is broken in 1.9.2 as shipped: groups.list returns 403 to a guest and suggestions.mention returns the same groups. For users it is an incomplete fix of fa2c49878, "Remove user listing for guests", which added authorize(actor, "listUsers", actor.team) to users.list on main and left the second reader untouched.

Details

server/routes/api/suggestions/suggestions.ts:

router.post("suggestions.mention", auth(), pagination(), validate(...), async (ctx) => {
  const actor = ctx.state.auth.user;
  const [documents, users, groups, collections] = await Promise.all([
    ...
    User.findAll({
      where: { teamId: actor.teamId, suspendedAt: { [Op.eq]: null },
        [Op.and]: query ? { [Op.or]: [ email like :query, name like :query ] } : {} },
      order: [["name", "ASC"]], offset, limit,
    }),
    Group.findAll({
      where: { teamId: actor.teamId, disableMentions: false, ... },
      order: [["name", "ASC"]], offset, limit,
    }),

auth() has no role option, so guests reach it. The only per-record gate is inside presentUser, which decides whether to include the email and the de…

Source: GitHub Repository Security Advisories (Game のスタック) GitHub Advisory OSV

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details