Skip to content

Commit 093a725

Browse files
committed
Adds WP.Security.SafeRedirect documentation.
1 parent 2f396d1 commit 093a725

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<documentation title="Safe Redirect">
2+
<standard>
3+
<![CDATA[
4+
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.
5+
]]>
6+
</standard>
7+
<code_comparison>
8+
<code title="Valid: Redirect can only go to allowed domains.">
9+
<![CDATA[
10+
<em>wp_safe_redirect</em>( $location );
11+
]]>
12+
</code>
13+
<code title="Invalid: Unsafe redirect, can be abused.">
14+
<![CDATA[
15+
<em>wp_redirect</em>( $location );
16+
]]>
17+
</code>
18+
</code_comparison>
19+
</documentation>

0 commit comments

Comments
 (0)