[Pkg-privacy-commits] [torbrowser-launcher] 02/05: Prevent attempts at directory traversal attacks, even though they do not look exploitable

Holger Levsen holger at moszumanska.debian.org
Wed Mar 16 00:27:35 UTC 2016


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch debian/sid
in repository torbrowser-launcher.

commit ee51fce13a28472ad8037a4513ee2a9a8c0e3288
Author: Micah Lee <micah at micahflee.com>
Date:   Sun Mar 13 14:56:42 2016 -0700

    Prevent attempts at directory traversal attacks, even though they do not look exploitable
---
 torbrowser_launcher/launcher.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/torbrowser_launcher/launcher.py b/torbrowser_launcher/launcher.py
index 442c6f4..a05c4a1 100644
--- a/torbrowser_launcher/launcher.py
+++ b/torbrowser_launcher/launcher.py
@@ -435,7 +435,14 @@ class Launcher:
         tree = ET.parse(self.common.paths['version_check_file'])
         for up in tree.getroot():
             if up.tag == 'update' and up.attrib['appVersion']:
-                return str(up.attrib['appVersion'])
+                version = str(up.attrib['appVersion'])
+
+                # make sure the version does not contain directory traversal attempts
+                # e.g. "5.5.3", "6.0a", "6.0a-hardned" are valid but "../../../../.." is invalid
+                if not re.match(r'^[a-z0-9\.\-]+$', version):
+                    return None
+
+                return version
         return None
 
     def verify(self):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/torbrowser-launcher.git



More information about the Pkg-privacy-commits mailing list