mirror of
https://github.com/znc/znc.git
synced 2026-05-02 11:32:29 +02:00
Don't let web skin name ../../../../ access files outside of usual skins directories.
Thanks for Jeriko One <jeriko.one@gmx.us> for finding and reporting this.
This commit is contained in:
@@ -557,13 +557,15 @@ CWebSock::EPageReqResult CWebSock::PrintTemplate(const CString& sPageName,
|
||||
}
|
||||
|
||||
CString CWebSock::GetSkinPath(const CString& sSkinName) {
|
||||
CString sRet = CZNC::Get().GetZNCPath() + "/webskins/" + sSkinName;
|
||||
const CString sSkin = sSkinName.Replace_n("/", "_").Replace_n(".", "_");
|
||||
|
||||
CString sRet = CZNC::Get().GetZNCPath() + "/webskins/" + sSkin;
|
||||
|
||||
if (!CFile::IsDir(sRet)) {
|
||||
sRet = CZNC::Get().GetCurPath() + "/webskins/" + sSkinName;
|
||||
sRet = CZNC::Get().GetCurPath() + "/webskins/" + sSkin;
|
||||
|
||||
if (!CFile::IsDir(sRet)) {
|
||||
sRet = CString(_SKINDIR_) + "/" + sSkinName;
|
||||
sRet = CString(_SKINDIR_) + "/" + sSkin;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user