You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WordPress.Security.ValidatedSanitizedInput.MissingUnslash and WordPress.Security.ValidatedSanitizedInput.InputNotSanitized on unused SuperGlobals #2526
WordPress.Security.ValidatedSanitizedInput.MissingUnslash and WordPress.Security.ValidatedSanitizedInput.InputNotSanitized are triggered on this type of code:
if ( isset( $_POST[ 'thing'] ) // here the flag is not triggered
&& $_POST[ 'thing'] // here the flags are triggered
) {
Note that $_POST['thing'] is never actually used - only checked upon. No matter what is passed in the super global, sanitizing or unlashing it wont change the result of this check, or in other words, allow an attack or else issue.
Minimal Code Snippet
if ( isset( $_POST[ 'thing'] ) // here the flag is not triggered
&& $_POST[ 'thing'] // here the flag is triggered
) {
do whatever else NOT using $_POST
}
The slashes do not affect the boolean value. "a \"quoted\" value" is still true.
We’re just checking presence and truthiness. We are never actually using the value.