Shell Code Injection in hsi backend

Bug #1519103 reported by Bernd Dietzel
258
This bug affects 1 person
Affects Status Importance Assigned to Milestone
duplicity (Ubuntu)
Confirmed
High
Unassigned
Nominated for Xenial by Vej
Nominated for Yakkety by Vej
Nominated for Zesty by Vej

Bug Description

The "hsi" backend of duplicity is vulnerabe to code injections.

It uses os.popen3() with should be replaced with subprocess.Popen().

Thank you.

File :
-------
/usr/lib/python2.7/dist-packages/duplicity/backends/hsibackend.py

This is the function witch is vulnerable :
------------------------------------------------------------
    def _list(self):
        commandline = '%s "ls -l %s"' % (hsi_command, self.remote_dir)
        l = os.popen3(commandline)[2].readlines()[3:]

Exploit Demo :
============

On the Terminal type in :

$ duplicity 'hsi://bug/";xeyes;"/test/' /tmp/bug

--> This will start the program xeyes , but should not.

I attached a screenshot of the exploit demo.

ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: duplicity 0.7.02-1ubuntu1
ProcVersionSignature: Ubuntu 4.2.0-18.22-generic 4.2.3
Uname: Linux 4.2.0-18-generic x86_64
ApportVersion: 2.19.1-0ubuntu5
Architecture: amd64
CurrentDesktop: MATE
Date: Mon Nov 23 22:09:23 2015
InstallationDate: Installed on 2015-11-13 (9 days ago)
InstallationMedia: Ubuntu 15.10 "Wily Werewolf" - Release amd64 (20151021)
SourcePackage: duplicity
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Bernd Dietzel (l-ubuntuone1104) wrote :
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Thanks for reporting this issue. Have you reported it to the duplicity developers?

If not, please report it to them in their bug tracker here:
https://bugs.launchpad.net/duplicity

and link the bug to this one.

Thanks!

Revision history for this message
Bernd Dietzel (l-ubuntuone1104) wrote :
information type: Private Security → Public Security
Vej (vej)
Changed in duplicity (Ubuntu):
status: New → Confirmed
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

This bug was fixed in duplicity 0.7.07.

Revision history for this message
Vej (vej) wrote :

This is fixed upstream since duplicity 0.7.07 (https://launchpad.net/duplicity/0.7-series/0.7.07). Please consider this for a SRU.

Vej (vej)
tags: added: xenial yakkety zesty
Changed in duplicity (Ubuntu):
importance: Undecided → High
Norbert (nrbrtx)
tags: removed: wily yakkety zesty
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.