Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Mitigate web cache poisoning for /sdk/goals endpoint #475

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

keelerm84
Copy link
Member

@keelerm84 keelerm84 commented Feb 5, 2025

No description provided.

Despite the name, only a small subset of the relay proxy is actually a
proxy.

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.
@keelerm84 keelerm84 requested a review from a team as a code owner February 5, 2025 16:52
@keelerm84 keelerm84 requested a review from a team February 5, 2025 16:52
@keelerm84 keelerm84 merged commit a6ee692 into v8 Feb 5, 2025
8 checks passed
@keelerm84 keelerm84 deleted the mk/sdk-1063/cache-issue branch February 5, 2025 18:04
keelerm84 pushed a commit that referenced this pull request Feb 5, 2025
🤖 I have created a release *beep* *boop*
---


##
[8.10.6](v8.10.5...v8.10.6)
(2025-02-05)


### Bug Fixes

* **deps:** bump supported Go versions to 1.23.6 and 1.22.12
([#476](#476))
([1ce9396](1ce9396))
* **deps:** update Dockerfiles from 3.21.0 to alpine:3.21.1
([#470](#470))
([5b7a450](5b7a450))
* **deps:** update Dockerfiles from 3.21.1 to alpine:3.21.2
([#472](#472))
([580c48f](580c48f))
* Mitigate web cache poisoning for `/sdk/goals` endpoint
([#475](#475))
([a6ee692](a6ee692))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants