Restrict WP.com media request authentication to WP.com hosts - #25863
Open
crazytonyli wants to merge 3 commits into
Open
Restrict WP.com media request authentication to WP.com hosts#25863crazytonyli wants to merge 3 commits into
crazytonyli wants to merge 3 commits into
Conversation
A 2020 change accidentally disabled the host allowlist guard in MediaRequestAuthenticator, so media requests for private WP.com sites attached the account-wide OAuth Bearer token to any URL, including attacker-controlled external hosts embedded in post content. Restore the allowlist (wordpress.com and wp.com domains) and enforce it inside tokenAuthenticatedWPComRequest so every request path is covered.
The AVURLAsset path in MediaRequestAuthenticator attached the WP.com Bearer token to video and audio URLs without any host check. Apply the same allowlist used for media requests, and enforce https like the request paths already do.
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 33580 | |
| Version | PR #25863 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | f4c1e0e | |
| Installation URL | 7hh6e0d9blu4o |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 33580 | |
| Version | PR #25863 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | f4c1e0e | |
| Installation URL | 7avqjar2eo1ro |
DNS hostnames are case-insensitive (RFC 4343) but URL.host preserves the input casing, so a WP.com host with uppercase letters would fail the allowlist and load private media unauthenticated. Lowercase the host before matching.
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
Fixes https://linear.app/a8c/issue/CMM-2195.
See the Linear issue for details.