Skip to content

Commit

Permalink
security: protect XSS seekers from their own hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
tpruvot committed Apr 10, 2018
1 parent 60fb627 commit e97ea63
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions web/yaamp/modules/renting/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

$address = getparam('address');
if($address == 0) $address = '';
if (!empty($address) && preg_match('/[^A-Za-z0-9]/', $address)) {
die;
}

echo <<<end
Expand Down
4 changes: 4 additions & 0 deletions web/yaamp/modules/site/wallet.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
}

$address = getparam('address');
if (!empty($address) && preg_match('/[^A-Za-z0-9]/', $address)) {
// Just to make happy XSS seekers who can hack their own browser html...
die;
}

$drop_address = getparam('drop');
if (!empty($drop_address)) {
Expand Down
3 changes: 3 additions & 0 deletions web/yaamp/modules/trading/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
$height = '240px';

$wallet = user()->getState('yaamp-wallet');
if (!empty($wallet) && preg_match('/[^A-Za-z0-9]/', $wallet)) {
die;
}
$user = getuserparam($wallet);

$algo_unit = 'Mh';
Expand Down

0 comments on commit e97ea63

Please sign in to comment.