f32002ce50edc3891f1fa41173132c820b917d57.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. From f32002ce50edc3891f1fa41173132c820b917d57 Mon Sep 17 00:00:00 2001
  2. From: Marco Martin <notmart@gmail.com>
  3. Date: Mon, 5 Feb 2018 13:12:51 +0100
  4. Subject: Make sure device paths are quoted
  5. in the case a vfat removable device has $() or `` in its label,
  6. such as $(touch foo) the quoted command may get executed,
  7. leaving an attack vector. Use KMacroExpander::expandMacrosShellQuote
  8. to make sure everything is quoted and not interpreted as a command
  9. BUG:389815
  10. ---
  11. solid-kf6uiserver/deviceserviceaction.cpp | 2 +-
  12. 1 file changed, 1 insertion(+), 1 deletion(-)
  13. diff --git a/solid-kf6uiserver/deviceserviceaction.cpp b/solid-kf6uiserver/deviceserviceaction.cpp
  14. index f49c967..738b27c 100644
  15. --- a/solid-kf6uiserver/deviceserviceaction.cpp
  16. +++ b/solid-kf6uiserver/deviceserviceaction.cpp
  17. @@ -158,7 +158,7 @@ void DelayedExecutor::delayedExecute(const QString &udi)
  18. QString exec = m_service.exec();
  19. MacroExpander mx(device);
  20. - mx.expandMacros(exec);
  21. + mx.expandMacrosShellQuote(exec);
  22. KRun::runCommand(exec, QString(), m_service.icon(), 0);
  23. deleteLater();
  24. --
  25. cgit v0.11.2