diff --git a/content/browser/web_package/subresource_signed_exchange_url_loader_factory.cc b/content/browser/web_package/subresource_signed_exchange_url_loader_factory.cc index 212710215243a..ee40559a9e7a4 100644 --- a/content/browser/web_package/subresource_signed_exchange_url_loader_factory.cc +++ b/content/browser/web_package/subresource_signed_exchange_url_loader_factory.cc @@ -101,7 +101,18 @@ void SubresourceSignedExchangeURLLoaderFactory::CreateLoaderAndStart( NOTREACHED(); } - DCHECK_EQ(request.url, entry_->inner_url()); + // `request.url` is renderer-supplied and is consumed by the CORS and ORB + // checks in SignedExchangeInnerResponseURLLoader. It must match the inner + // URL this factory was bound to; otherwise a compromised renderer could + // spoof a same-origin URL to bypass those checks. + if (request.url != entry_->inner_url()) { + mojo::ReportBadMessage( + "SubresourceSignedExchangeURLLoaderFactory: url VS inner_url mismatch"); + mojo::Remote(std::move(client)) + ->OnComplete( + network::URLLoaderCompletionStatus(net::ERR_INVALID_ARGUMENT)); + return; + } mojo::MakeSelfOwnedReceiver( std::make_unique( request, entry_->inner_response().Clone(),