mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
login.php: Escape quotes in the referer field
Replace special characters in the referer GET parameter using htmlspecialchars() before inserting it into the login form fields to prevent from XSS attacks. Fixes FS#55286. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
4efba18f86
commit
e2fa5ea6fa
1 changed files with 1 additions and 1 deletions
|
@ -41,7 +41,7 @@ html_header('AUR ' . __("Login"));
|
|||
<input type="submit" class="button" value="<?php print __("Login"); ?>" />
|
||||
<a href="<?= get_uri('/passreset/') ?>">[<?= __('Forgot Password') ?>]</a>
|
||||
<?php if (in_request('referer') !== ""): ?>
|
||||
<input id="id_referer" type="hidden" name="referer" value="<?= in_request('referer') ?>" />
|
||||
<input id="id_referer" type="hidden" name="referer" value="<?= htmlspecialchars(in_request('referer'), ENT_QUOTES) ?>" />
|
||||
<?php elseif (isset($_SERVER['HTTP_REFERER'])): ?>
|
||||
<input id="id_referer" type="hidden" name="referer" value="<?= htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_QUOTES) ?>" />
|
||||
<?php endif; ?>
|
||||
|
|
Loading…
Add table
Reference in a new issue