Open
Description
The second arg of the wp_localize_script()
function, $object_name
, is directly interpolated into the JS without any escaping. Per the docs:
* @param string $object_name Name for the JavaScript object. Passed directly, so it should be qualified JS variable.
* Example: '/[a-zA-Z0-9_]+/'.
Believe it or not, some plugins use dynamic object names, even incorporating untrusted data. I think it makes sense add a sniff that requires the value to be properly escaped.