wordfence WFLSVars are created without nonce or SRI hash
-
Im am hardening a website, and while using CSP technique, I am disabling unsafe inline sccripts, and those can only run with an nonce or a hash of the script in it’s script tag’s “integrity” attribute.
But the script pointing to ajax is output to the page without any of those:
<script type='text/javascript' id='wordfence-ls-login-js-extra'> /* <![CDATA[ */ var WFLSVars = {"ajaxurl":"https:\/\/my.domain\/admin-ajax\/","nonce":"4143373920","recaptchasitekey":"","useCAPTCHA":"","allowremember":"","verification":""}; /* ]]> */ </script>
The nonce /inside/ the code changes every couple of hours or so, so the has for this whole script changes as well. effectively this is impossible to use as I cannot hash the script and add the hash to my CSP allowed hashes.
Can I remove the nonce from there or can this have an integrity tag?
relevant -> https://stackoverflow.com/questions/70855692/csp-and-script-localization-in-wordpress
- The topic ‘wordfence WFLSVars are created without nonce or SRI hash’ is closed to new replies.