Skip to content

Conversation

AltanS
Copy link
Contributor

@AltanS AltanS commented Jan 22, 2025

Assuming a website chooses to cache responses for specific API routes in the WP REST API (like /wp-json/wp/v2/posts). An attacker could use the X-HTTP-Method-Override header to request an endpoint (i.e. /wp/v2/posts/1) until the cache is STALE and trigger an update of the cache from the response that served the HEAD request instead of the GET request. The endpoint would then return an empty response body.

Normal routes are not affected by this, but since WP allows method overrides against the REST API, this could become an issue for headless WP instances.

Copy link
Member

@retlehs retlehs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appreciate both the PR and the background. This is a nice update — thank you!

@swalkinshaw swalkinshaw merged commit ae31b0f into roots:master Jan 27, 2025
2 checks passed
@swalkinshaw
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants