Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added additional verification of host domain in password reset.
Thanks to @FalzoMAD and @mmetince - this commit fixes #748
  • Loading branch information
Kristan Kenney committed Mar 23, 2020
1 parent 5ffb7ac commit cd5d3c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.

### Bugfixes
- Fixed phpMyAdmin blowfish and tmp directory issues.
- Added additional verification of host domain in password reset. Thanks to @FalzoMAD and @mmetince!

## [1.1.0] - 2020-03-11 - Major Release (Feature / Quality Update)
### Features
Expand Down
13 changes: 8 additions & 5 deletions web/reset/index.php
Expand Up @@ -30,13 +30,16 @@
} else {
$mailtext = __('GREETINGS');
}
$mailtext .= __('PASSWORD_RESET_REQUEST',$_SERVER['HTTP_HOST'],$user,$rkey,$_SERVER['HTTP_HOST'],$user,$rkey);
if (!empty($rkey)) send_email($to, $subject, $mailtext, $from);
if (in_array(str_replace(':'.$_SERVER['SERVER_PORT'],'.conf',$_SERVER['HTTP_HOST']), array_merge(scandir('/etc/nginx/conf.d'),scandir('/etc/nginx/conf.d/domains'),scandir('/etc/apache2/conf.d/domains'),scandir('/etc/apache2/conf.d')))){
$mailtext .= __('PASSWORD_RESET_REQUEST',$_SERVER['HTTP_HOST'],$user,$rkey,$_SERVER['HTTP_HOST'],$user,$rkey);
if (!empty($rkey)) send_email($to, $subject, $mailtext, $from);
header("Location: /reset/?action=code&user=".$_POST['user']);
exit;
} else {
$ERROR = "<a class=\"error\">".__('Invalid host domain')."</a>";
}
unset($output);
}

header("Location: /reset/?action=code&user=".$_POST['user']);
exit;
}

if ((!empty($_POST['user'])) && (!empty($_POST['code'])) && (!empty($_POST['password'])) ) {
Expand Down

0 comments on commit cd5d3c0

Please sign in to comment.