Skip to content

Commit

Permalink
fix: Zip Path Traversal (#181)
Browse files Browse the repository at this point in the history
Zip Path Traversal

Bug: https://pms.uniontech.com/bug-view-232873.html

Log: Zip Path Traversal
  • Loading branch information
myk1343 authored May 28, 2024
1 parent 85e5836 commit e809e38
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions 3rdparty/libzipplugin/libzipplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,11 @@ ErrorType LibzipPlugin::extractEntry(zip_t *archive, zip_int64_t index, const Ex
}

strFileName = m_common->trans2uft8(statBuffer.name, m_mapFileCode[index]); // 解压文件名(压缩包中)
//fix 232873
if(strFileName.indexOf("../") != -1) {
qInfo() << "skipped ../ path component(s) in " << strFileName;
strFileName = strFileName.replace("../", "");
}
if(strFileName.contains(QLatin1Char('\\')))
strFileName = strFileName.replace(QLatin1Char('\\'), QDir::separator());
QString strOriginName = strFileName;
Expand Down

0 comments on commit e809e38

Please sign in to comment.