Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CVE-2016-10351: Insecure cWorkingDir permissions. #3842

Merged
merged 1 commit into from Sep 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Fix CVE-2016-10351: Insecure cWorkingDir permissions.
Set 700 permisson on dir on every start.

Signed-off-by: Alexander GQ Gerasiov <gq@cs.msu.su>
  • Loading branch information
gerasiov committed Aug 28, 2017
commit 388703b9ca1912a5438e37f9dd54c35805f2c594
7 changes: 6 additions & 1 deletion Telegram/SourceFiles/settings.h
Expand Up @@ -77,7 +77,12 @@ DeclareReadSetting(LaunchMode, LaunchMode);
DeclareSetting(QString, WorkingDir);
inline void cForceWorkingDir(const QString &newDir) {
cSetWorkingDir(newDir);
if (!gWorkingDir.isEmpty()) QDir().mkpath(gWorkingDir);
if (!gWorkingDir.isEmpty()) {
QDir().mkpath(gWorkingDir);
QFile::setPermissions(gWorkingDir,
QFileDevice::ReadUser | QFileDevice::WriteUser | QFileDevice::ExeUser);
}

}
DeclareReadSetting(QString, ExeName);
DeclareReadSetting(QString, ExeDir);
Expand Down