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
WPCS has some good documentation that's exposed with --generator=Text. It includes an explanation of an error, with examples of what to do and not do. e.g.:
> phpcs ./foo.php --standard=WordPress --generator=Text
--------------------------------------------
| WORDPRESS CODING STANDARD: SAFE REDIRECT |
--------------------------------------------
wp_safe_redirect() should be used whenever possible to prevent open redirect vulnerabilities. One of
the main uses of an open redirect vulnerability is to make phishing attacks more credible. In this
case the user sees your (trusted) domain and might get redirected to an attacker controlled website
aimed at stealing private information.
----------------------------------------- CODE COMPARISON ------------------------------------------
| Valid: Redirect can only go to allowed | Invalid: Unsafe redirect, can be abused. || domains. ||
----------------------------------------------------------------------------------------------------
| wp_safe_redirect( $location );| wp_redirect( $location );|
Some ideas we could do with that:
include that option in our messaging to plugin authors, to make sure they know about it. that could be in the brief error reports you get without --generator=Text, and in any emails we send them, etc
WPCS has some good documentation that's exposed with
--generator=Text
. It includes an explanation of an error, with examples of what to do and not do. e.g.:Some ideas we could do with that:
--generator=Text
, and in any emails we send them, etcxref https://wordpress.slack.com/archives/C5VCTJGH3/p1619591353086600
The text was updated successfully, but these errors were encountered: