Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,6 @@
"description[zh_CN]": "通知自动清理的天数,超过此天数的通知将被自动删除",
"permissions": "readwrite",
"visibility": "public"
},
"safeCommands": {
"value": ["xdg-open","dbus-send","qdbus","deepin-defender","dde-control-center","downloader","dde-file-manager","dde-dconfig","/usr/lib/deepin-daemon/dde-bluetooth-dialog","/usr/bin/dde-hints-dialog","/usr/bin/deepin-devicemanager"],
"serial": 0,
"flags": [],
"name": "safe commands",
"name[zh_CN]": "安全指令",
"description": "safe commands",
"description[zh_CN]": "通知扩展的x-deepin-action-携带的指令白名单",
"permissions": "readonly",
"visibility": "private"
}
}
}
8 changes: 0 additions & 8 deletions panels/notification/server/notificationmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,14 +533,6 @@ void NotificationManager::doActionInvoked(const NotifyEntity &entity, const QStr
if (!args.isEmpty()) {
QString cmd = args.takeFirst(); // 命令

QScopedPointer<DConfig> config(DConfig::create("org.deepin.dde.shell", "org.deepin.dde.shell.notification"));
QStringList safeCommands = config->value("safeCommands").toStringList();

if (!safeCommands.contains(cmd)) {
qWarning(notifyLog) << "The command is not allowed to be executed:" << cmd << safeCommands;
Comment on lines -536 to -540
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): Removing the safeCommands allowlist introduces a potential command execution risk.

Without the safeCommands check, any cmd from the notification is passed to QProcess, which allows arbitrary command execution if entity/args can be influenced by untrusted input. Unless there is equivalent validation elsewhere, this is a security risk. Please reintroduce an allowlist or add strong validation to constrain which commands can be run.

return;
}

QProcess pro;
pro.setProgram(cmd);
pro.setArguments(args);
Expand Down