Skip to content

Commit

Permalink
do not cache (implicit) request access to form data or cookies in `ot…
Browse files Browse the repository at this point in the history
…her`: #630
  • Loading branch information
d-maurer committed May 18, 2019
1 parent 7ad558e commit 7095f8b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ Fixes
- Fixed logic error in exceptions handling during publishing. This error would
prevent correct Unauthorized handling when exceptions debug mode was set.

- Do not cache (implicit) request access to form data and cookies in ``other``
(`#630 <https://github.com/zopefoundation/Zope/issues/630>`_).


4.0 (2019-05-10)
----------------
Expand Down
12 changes: 8 additions & 4 deletions src/ZPublisher/HTTPRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1371,26 +1371,30 @@ def get(self, key, default=None, returnTaints=0,
if returnTaints:
v = self.taintedform.get(key, _marker)
if v is not _marker:
other[key] = v
# Issue 630
# other[key] = v
return v

# Untrusted data *after* trusted data
v = self.form.get(key, _marker)
if v is not _marker:
other[key] = v
# Issue 630
# other[key] = v
return v

# Return tainted data first (marked as suspect)
if returnTaints:
v = self.taintedcookies.get(key, _marker)
if v is not _marker:
other[key] = v
# Issue 630
# other[key] = v
return v

# Untrusted data *after* trusted data
v = self.cookies.get(key, _marker)
if v is not _marker:
other[key] = v
# Issue 630
# other[key] = v
return v

return default
Expand Down

0 comments on commit 7095f8b

Please sign in to comment.