Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shell Injection when changing Colors of a folder #970

Closed
TheRegRunner opened this issue Sep 19, 2015 · 4 comments
Closed

Shell Injection when changing Colors of a folder #970

TheRegRunner opened this issue Sep 19, 2015 · 4 comments

Comments

@TheRegRunner
Copy link

nemo demo exploid kills firefox

Demo Exploit

  1. start firefox

  2. rename a folder with nemo to this folder name

";killall firefox;#

  1. Now change the COLOR of the folder with nemo to some other color

  2. Firefox will be killed for a prove of concept.


Reason is line 159 in nemo-folder-color-switcher.py

       # Touch the directory to make Nemo re-render its icons
        os.system("touch \"%s\"" % path)

The shell command in the folder path will be injected with os.system()

Please use subprocess, not os.system()
Thanks

@TheRegRunner
Copy link
Author

Same Problem with filenames when you change the emblem with nemo

Line 132 in nemo-emblems.py

os.system("touch "%s"" % self.filename) # touch the file (to force Nemo to re-render its icon)

@TheRegRunner
Copy link
Author

Exploit Demo Video (german)

https://youtu.be/E6IOHFeo9bE

@bitboy85
Copy link

Instead of spawning an external process i prefer using a build-in python function
Change: os.system("touch "%s"" % path)
To: os.utime(path, None)

Both act the same. touch will update the timestamp of last access, same does os.utime(None = Current time)

@TheRegRunner
Copy link
Author

Don't forget to fix Line 132 in nemo-emblems.py
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants