Skip to main content
Menu
Advisories

Apollo Router information disclosure via improper validation of GraphQL values in supergraph schemas

GHSA-6P7Q-4GQ4-4VF7Published Updated GitHub

Description

Impact

Improper input validation that can result in information disclosure.

Apollo Router validates a supergraph schema's structure when loading it, but not that the GraphQL values within it (such as default values) are valid for that schema. Rust-native composition does not error on or omit invalid values, so subgraphs that are valid GraphQL can compose into an invalid supergraph in which a field-argument default value references an @inaccessible input field. Router does not catch this, API schema validation passes, and the @inaccessible field's value is exposed to clients through the default value (for example, via introspection or the served API schema).

The subgraphs below compose into a supergraph whose foo default value references the @inaccessible field hidden:

# Subgraph A
type Query {
  foo(arg: Foo = { qax: true, bar: { hidden: "hidden" } }): Boolean
}

input Foo {
  bar: Bar
  qax: Boolean
}

input Bar {
  hidden: String @inaccessible
  visible: String
}

# Subgraph B
input Foo {
  bar: Bar
  qux: Boolean
}

input Bar {
  hidden: String @inaccessible
  visible: String
}

Router then computes an API schema that leaks the hidden value it was meant to exclude:

type Query {
  foo(arg: Foo = {qax: true, bar: {hidden: "hidden"}}): Boolean
}

input Foo {
  bar: Bar
}

input Bar {
  visible: String
}

Patches

Users should upgrade to Router 2.16.1. If using Federation Build Track version 2.15, the latest version of composition will automatically be used, which leverages the patched apollo-federation crate. Prior build tracks are not impacted.

Workarounds

There is no configuration-level workaround in Router.

Affected versions

References

GitHub · apollographql/router