PT-2022-28222 · Unknown · Apollo Server
Published
2022-11-02
·
Updated
2022-11-02
None
No severity ratings or metrics are available. When they are, we'll update the corresponding info on the page.
Name of the Vulnerable Software and Affected Versions
Apollo Server versions 3.0.0 through 3.10.0
Apollo Server versions 4.0.0 through 4.0.0
Description
The
cache-control HTTP response header may not reflect the cache policy for HTTP requests with multiple operations using HTTP batching. This could lead to data being inappropriately cached and shared. The issue affects Apollo Server 3 and 4, where plugins can set HTTP response headers, but for batched requests, plugins assemble a separate set of response headers in parallel for each operation, and then the header sets are merged together. If plugins set the same header on multiple operations, one value is chosen arbitrarily. This means that if a client sent a batched HTTP request with two operations with different cache policies, Apollo Server 3 and 4 would return a cache-control header that only applies to one of the operations. The issue could lead to cache poisoning attacks.Recommendations
For Apollo Server 3, upgrade the package to v3.11.0 to restore the behavior where the cache control plugin never sets the
cache-control HTTP response header on batched requests.
For Apollo Server 4, upgrade @apollo/server to v4.1.0 to make the response HTTP header object seen by plugins shared among all plugins processing all operations on a request, and to make the cache control plugin merge cache-control header values across operations in a request.
As a temporary workaround, consider disabling either the HTTP batching feature by passing allowBatchedHttpRequests: false to new ApolloServer or the cache-control header feature by adding ApolloServerPluginCacheControl({ calculateHttpHeaders: false }) to the plugins list in new ApolloServer(). Found an issue in the description? Have something to add? Feel free to write us 👾
Weakness Enumeration
Related Identifiers
Affected Products
Apollo Server