Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Mitigate web cache poisoning for
/sdk/goals
endpoint (#475)
Client SDKs communicating with the `/sdk/goals` endpoint rely on a reverse proxy to our upstream endpoints. These requests make use of a caching transport as a way to try and reduce traffic. This cache was keyed solely on the request path, allowing a malicious actor to "poison" the cache by making a request with a valid `If-None-Match` header. The proxy would pass through the request as is, receive a `304 NOT MODIFIED` from upstream, then dutifully cache the response. When a subsequent request came through, even without the `If-None-Match` header, the cached response would be loaded, the previously seen `ETag` header would be loaded and sent forward, resulting in an invalid `304 NOT MODIFIED` response. To mitigate this, we are removing the intermediate caching transport. Removing this seemingly would increase traffic to our upstream endpoints as we are removing a caching layer. However, the `/sdk/goals` endpoint returns a `Cache-Control: max-age=0`, which undermined the original intent of the caching transport. As a result, all calls are being directly proxied regardless.
- Loading branch information