- Joined
- Oct 27, 2011
- Messages
- 382
- Reaction score
- 172
Removed.
Last edited:
Imagine what would happen if someone used a spambot on your lobby.
??????? What? WhereImagine a troll saying "'; DROP TABLE Login;--".
Inside the chatbox, the string he posted will get executed in the query.
Inside the chatbox, the string he posted will get executed in the query.
Yeye, not only chatbox. You can name clan or charname and boom
With fake client ofc
or this "';shutdown--"Imagine a troll saying "'; DROP TABLE Login;--".
You guys are acting worse then needed..
Add a filter to it..
2
TCHAR g_szDB_LOBBY_CHAT[] = _T("{CALL spInsertLobbyChat ('%s', '%s')}");
bool MMatchDBMgr::LobbyChat(const TCHAR* szName, const char* szMsg)
{
_STATUS_DB_START;
[COLOR="#FF0000"]if(strstr(szName, ";")) return false;[/COLOR]
if (!CheckOpen()) return false;
CString strSQL;
try {
strSQL.Format( g_szDB_LOBBY_CHAT, szName, szMsg );
m_DB.ExecuteSQL( strSQL );
}
catch(CDBException* e) {
ExceptionHandler(strSQL, e);
return false;
}
_STATUS_DB_END(12);
return true;
}
Imagine what would happen if someone used a spambot on your lobby.
Code:TCHAR g_szDB_LOBBY_CHAT[] = _T("{CALL spInsertLobbyChat ('%s', '%s')}"); bool MMatchDBMgr::LobbyChat(const TCHAR* szName, const char* szMsg) { _STATUS_DB_START; [COLOR=#FF0000]if(strstr(szName, ";")) return false;[/COLOR] if (!CheckOpen()) return false; CString strSQL; try { strSQL.Format( g_szDB_LOBBY_CHAT, szName, szMsg ); m_DB.ExecuteSQL( strSQL ); } catch(CDBException* e) { ExceptionHandler(strSQL, e); return false; } _STATUS_DB_END(12); return true; }
Our full version that it won't print same message more than 2 times.
Don't need the ";", I could still use the ' and launch a DoS attack by generating SQL errors.
Don't need the ";", I could still use the ' and launch a DoS attack by generating SQL errors.