Skip to content

Commit

Permalink
Fix URL redirection issue in login_page.php
Browse files Browse the repository at this point in the history
The fix for issue #17648 failed to correct all cases of redirection.

Alejo Popovici discovered that the regex checking for URLs pointing to
other domains considered an URL with a single '/' as local, allowing
redirection e.g. to http:/google.com on certain browsers.

Fixes #17997 (CVE-2014-6316)
  • Loading branch information
dregad committed Jan 10, 2015
1 parent 5571bcf commit d95f070
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions core/string_api.php
Expand Up @@ -252,8 +252,7 @@ function string_sanitize_url( $p_url, $p_return_absolute = false ) {

# Check for URL's pointing to other domains
if ( 0 == $t_type || empty( $t_matches['script'] ) ||
3 == $t_type && preg_match( '@(?:[^:]*)?://@', $t_url ) > 0 ) {

3 == $t_type && preg_match( '@(?:[^:]*)?:/*@', $t_url ) > 0 ) {
return ( $p_return_absolute ? $t_path . '/' : '' ) . 'index.php';
}

Expand Down

0 comments on commit d95f070

Please sign in to comment.