Summary
Heym's team-member management checks whether a user belongs to a team but does not require creator or administrator privileges. A non-creator member may add an attacker-controlled account, which can then decrypt credentials shared with the team.
Affected context
The issue affects Heym deployments where team members can manage membership without a creator or administrator role check. Because credential sharing is scoped to team-member user IDs, adding an attacker-controlled account can expose credentials shared with that team, including provider API keys and OAuth tokens.
Exploit preconditions
- Attack surface: Team-member management operations, including adding, removing, or updating members
- Required access: Membership in the target team; creator or administrator privileges are not required by the described checks
- Trigger point: A non-creator member adds an attacker-controlled account to the team
- Why exploitation is possible: Team membership changes are authorized by membership alone, and credential access is associated with
TeamMember.user_idrather than a narrower role or permission.
Why this happens
The access-control logic treats team membership as sufficient authority for sensitive membership-management operations. This is a missing authorization check (CWE-862) and can also result in incorrect privilege assignment (CWE-266): ordinary members receive capabilities intended for a team creator or administrator. Since team-shared credentials are available based on membership, this permission gap can extend access to sensitive secrets.
Potential impact
- An attacker-controlled account may gain access to credentials shared with the team.
- Exposed API keys or OAuth tokens could be used to access connected services.
- Credential misuse may lead to unauthorized actions or data exposure in dependent systems.
- Team membership and access boundaries may be weakened.
General mitigation guidance
Common defensive patterns include:
- Enforce explicit role- or permission-based authorization for every membership-management operation.
- Apply least privilege by limiting add, remove, and update capabilities to designated administrators.
- Scope credential access to explicit grants rather than automatically granting it to every team member.
- Review authorization checks at the service or data-access boundary, not only in the user interface.
- Treat team membership changes and credential access as separate trust decisions, with auditable policy enforcement.
How teams detect issues like this
- Use static analysis and code review to identify membership checks that guard administrative operations without role or permission checks.
- Review routes and service methods for consistent authorization across add, remove, and update actions.
- Audit credential-sharing logic for access decisions based solely on team membership or user identifiers.
- Monitor membership changes by non-administrators and unusual access to shared credentials.
- Enforce policy tests that verify ordinary members cannot perform administrative actions or gain unintended secret access.

