The Media Request Protection feature has been introduced in Sitecore XP 7.5 to restrict media URLs that contain dynamic image-scaling parameters, so that only server-generated requests are processed. This ensures that the server only spends resources and disk space on valid image scaling requests.
This article provides different scenarios for troubleshooting the error MediaRequestProtection: An invalid/missing hash value was encountered:
The following message can be found in the logs:
ERROR MediaRequestProtection: An invalid/missing hash value was encountered. The expected hash value: 7D6A9AD7AB99A899D3DB57CDA568256C. Media URL: /-/media/images/logo.ashx?h=200&w=200, Referring URL: https://example.com
An invalid/missing hash value is treated as an error because Sitecore cannot verify the legitimacy of the request. As a result, Sitecore returns a response using default parameters, preventing the system from being overloaded by unverified requests.
To troubleshoot the issue, take these steps:
To troubleshoot the issue, take these steps:
When using Sitecore Headless Rendering, namely in a JSS application, the error message contains the jssmedia handler. For example:
Media URL: /-/jssmedia/images/logo.ashx?h=200&w=200
To troubleshoot the issue, verify whether the requested image size is explicitly allowed in the application configuration. See the example here.