Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions web/yaamp/core/backend/rawcoins.php
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,16 @@ function updateRawCoin($marketname, $symbol, $name='unknown')
{
if($symbol == 'BTC') return;

// Restrict $symbol and $name to strict defined set of characters (to protect from rogue exchange or DNS attack on exchange)
if (preg_match('/[^A-Za-z0-9_\$]/', $symbol)) {
debuglog("weird symbol $symbol from $marketname");
return;
}
if (preg_match('/[^A-Za-z0-9_\$ ]/', $name)) {
debuglog("weird name $name for symbol $symbol from $marketname");
return;
}

$coin = getdbosql('db_coins', "symbol=:symbol", array(':symbol'=>$symbol));
if(!$coin && YAAMP_CREATE_NEW_COINS)
{
Expand Down