mirror of
https://github.com/znc/znc.git
synced 2026-08-07 17:33:34 +02:00
Generate session IDs more securely
We now use a lot more data for generating the session id which is fed to a hash to make it impossible to attack specific parts of the input. Also we now retry generating a new session id in the (improbable) case of collision with an existing session id. Thanks a lot to cnu for pointing out the weakness in the old code by stealing my session cookie, you evil hacker! git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1819 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+3
-3
@@ -34,7 +34,7 @@ private:
|
||||
|
||||
class CWebSession {
|
||||
public:
|
||||
CWebSession(const CString& sId = "");
|
||||
CWebSession(const CString& sId);
|
||||
virtual ~CWebSession() {}
|
||||
|
||||
const CString& GetId() const { return m_sId; }
|
||||
@@ -135,14 +135,14 @@ public:
|
||||
|
||||
void PrintErrorPage(const CString& sMessage);
|
||||
|
||||
CSmartPtr<CWebSession> GetSession() const;
|
||||
CSmartPtr<CWebSession> GetSession();
|
||||
|
||||
virtual Csock* GetSockObj(const CString& sHost, unsigned short uPort);
|
||||
CString GetModWebPath(const CString& sModName) const;
|
||||
CString GetSkinPath(const CString& sSkinName) const;
|
||||
CModule* GetModule() const { return (CModule*) m_pModule; }
|
||||
size_t GetAvailSkins(vector<CFile>& vRet);
|
||||
CString GetSkinName() const;
|
||||
CString GetSkinName();
|
||||
|
||||
CString GetCookie(const CString& sKey) const;
|
||||
bool SetCookie(const CString& sKey, const CString& sValue);
|
||||
|
||||
Reference in New Issue
Block a user