Skip to content

Commit 0ac5693

Browse files
author
Richard Jones
committed
fix static file path normalisation in security check (thanks David Linke)
1 parent e9e7ab2 commit 0ac5693

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

CHANGES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Fixed:
3232
- ZRoundup's search interface works now (sf bug 994957)
3333
- fixed history display when "ascending"
3434
- removed references to py2.3+ boolean values (sf bug 995682)
35-
35+
- fix static file path normalisation in security check (thanks David Linke)
3636

3737

3838
2004-07-21 0.7.6

TODO.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ Required:
1111
- fix admin_guide referring to structure of trackers
1212
- add config.ini section descriptions
1313
- review use of hasPermission etc. in classic template
14+
- how to override Client class methods like determine_user?
1415

1516

1617
Optionally:
1718
- have rdbms backends look up the journal for actor if it's not set
1819
- migrate to numeric ID values (fixes bug 817217)
1920
- configuration editing in Web User Interface: core config,
2021
standalone server config, detectors and extensions configurations
22+
- refactor backends to have a common Database class that manages them all,
23+
allowing different Class implementations from differen backends in the
24+
one tracker

roundup/cgi/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.186 2004-07-28 02:29:45 richard Exp $
1+
# $Id: client.py,v 1.187 2004-08-02 22:41:12 richard Exp $
22

33
"""WWW request handler (also used in the stand-alone server).
44
"""
@@ -540,6 +540,9 @@ def serve_static_file(self, file):
540540
# outside of the static files dir
541541
prefix = getattr(self.instance.config, 'STATIC_FILES',
542542
self.instance.config.TEMPLATES)
543+
544+
# normalise the prefix and filename for the startswith comparison
545+
prefix = os.path.normpath(prefix)
543546
filename = os.path.normpath(os.path.join(prefix, file))
544547
if not filename.startswith(prefix):
545548
raise NotFound, file

0 commit comments

Comments
 (0)