Issue 2550701
Created on 2011-04-19 18:50 by joseph_myers, last changed 2016-07-14 22:34 by rouilj.
msg4301 |
Author: [hidden] (joseph_myers) |
Date: 2011-04-19 18:50 |
|
The Roundup code converting a template name (as passed in @template in a
request) to the path to a file is vulnerable to path traversal,
accessing files outside the templates directory, in some circumstances.
Specifically, suppose the templates directory has a subdirectory of the
form <classname>.<something>. Then a request for
<tracker
URL>/<classname>?@template=<something>/../../../../../../../etc/passwd
will use the contents of <templates
directory>/<classname>.<something>/../../../../../../../etc/passwd as a
template, typically revealing the contents of /etc/passwd.
Normally this would not be an issue because of the need for a
subdirectory with a name in a particular form, starting with a valid
class name (or _generic, etc.). But creating such subdirectories should
not cause files outside the directory to be disclosed, and it would seem
reasonable for an installation to use subdirectories if it has many
templates relating to a particular class, say a <classname>.templates
directory to collect those templates (so completely disallowing
directory separators in template names would disallow too much; a check
that the file is inside the templates directory, like that done for
serving static files, would be better).
|
msg5778 |
Author: [hidden] (rouilj) |
Date: 2016-07-08 00:13 |
|
msg5777 on issue 2550891 has a possible patch for this. It turns out
I re-implemented much of the cgi/client.py:Client::serve_static_file
logic to prevent path traversal. The only difference is the static
check uses normpath not realpath.
Note my patch only handles TAL based templates (zopetal and chameleon).
Jinja is handled on the issue.
|
msg5851 |
Author: [hidden] (rouilj) |
Date: 2016-07-14 22:34 |
|
Closing see changeset: d22eb1d40d0e
|
|
Date |
User |
Action |
Args |
2016-07-14 22:34:18 | rouilj | set | status: new -> fixed priority: high resolution: fixed messages:
+ msg5851 |
2016-07-08 00:13:12 | rouilj | set | assignee: rouilj messages:
+ msg5778 nosy:
+ rouilj |
2011-04-19 18:50:19 | joseph_myers | create | |
|