Skip to main content
Menu
Advisories

Authorization Bypass and Data Tampering via Entity Representations

GHSA-QFCM-85PQ-G95PPublished Updated GitHub

Description

A Hot Chocolate 16 Apollo Federation subgraph took too many fields of an entity from the client-supplied representation. When a client selected the _entities field, values the subgraph's reference resolver is supposed to own could be supplied, or overwritten, from the representation instead of coming from the resolver.

An application is affected when all of the following hold:

  • It runs a Hot Chocolate Apollo Federation subgraph (AddApolloFederation() / Apollo Federation types) on 16.5.0 or later.
  • It exposes an entity type (a type with @key and a reference resolver) that also has fields the subgraph owns, that is, fields that are neither part of a @key nor marked @external. This includes fields that carry authoritative values or that an authorization policy reads from the entity.
  • The subgraph's GraphQL endpoint is reachable by the client. In a router-fronted federation deployment the router builds representations from key fields only, so clients cannot supply them; the exposure is a directly reachable subgraph.

Versions before 16.5.0 are not affected. Fusion and Apollo Federation gateways are not affected.

Fixed Versions

  • 16.7.4

Impact

A client that can reach the subgraph's _entities field can supply values for fields the subgraph owns. Those values are applied to the entity the server resolves and returns, in place of the values the reference resolver would provide.

Where an owned field feeds an authorization decision, for example an ownership or tenant check that reads the entity, a client can set that field so the check passes and read protected data that belongs to another principal. Because the altered entity is also what the server resolves and returns, the supplied values are served to clients, so the same mechanism can be used to tamper with the data an entity reports.

This issue is classified as CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes.

Recommendation

Upgrade to 16.7.4 or later. The subgraph then takes only @key fields (to locate the entity) and @external field values from the representation, and owned fields keep the values from the reference resolver.

If an immediate upgrade is not possible, keep federation subgraphs private behind the router or gateway so untrusted clients cannot send crafted representations to the subgraph's _entities field.

Affected versions

References

GitHub · ChilliCream/graphql-platform