[FR] Config setting for changing the name of x-craft-preview and x-craft-live-preview query params #15605
-
|
Could we get config settings for changing the parameter names, similar to what we have with Since yesterday we're seeing DDOS attacks/vulnerability probing using x-craft-preview on several of our sites. With the cache poisoning issue being taken care of via #15589, it would be good to be able to mitigate the DDOS attacks by obfuscating the parameters, especially since they now will bypass the template caching. Hopefully there isn't a vulnerability related to outputting the preview parameter from untrusted sources to twig/urls, but considering that it's just a random string that isn't validated in any way, maybe it would be safer to just generate a new random string for each request, instead of using whatever is passed in? Or, add some kind of validation like the tokenParam has. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
A new random value is generated each time there is a content edit, to ensure that the browser doesn’t load the page from cache when we know something has changed. I don’t think there would be any benefit to changing it more frequently than that.
I like that idea. Just made that change for Craft 4.12 and 5.4 (f82baa7). So going forward, |
Beta Was this translation helpful? Give feedback.
A new random value is generated each time there is a content edit, to ensure that the browser doesn’t load the page from cache when we know something has changed. I don’t think there would be any benefit to changing it more frequently than that.
I like that idea. Just made that change for Craft 4.12 and 5.4 (f82baa7). So going forward,
craft\web\Request::getIsPreview()will only returntrueif thex-craft-preview/x-craft-live-preview…