Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
9f37c696
Commit
9f37c696
authored
Jul 05, 2013
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent zlib-based DoS when parsing the cookie containing paste tokens.
Fixes LP #1094049.
parent
ba2292bb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
doc/CHANGES.rst
doc/CHANGES.rst
+2
-0
src/OFS/CopySupport.py
src/OFS/CopySupport.py
+7
-3
No files found.
doc/CHANGES.rst
View file @
9f37c696
...
...
@@ -8,6 +8,8 @@ http://docs.zope.org/zope2/
2.12.28 (unreleased)
--------------------
- LP #1094049: prevent zlib-based DoS when parsing the cookie containing
paste tokens.
2.12.27 (2013-05-01)
--------------------
...
...
src/OFS/CopySupport.py
View file @
9f37c696
...
...
@@ -25,7 +25,7 @@ from urllib import quote
from
urllib
import
unquote
import
warnings
from
zlib
import
compress
from
zlib
import
decompress
from
zlib
import
decompress
obj
import
transaction
from
AccessControl
import
ClassSecurityInfo
...
...
@@ -649,8 +649,12 @@ def absattr(attr):
def
_cb_encode
(
d
):
return
quote
(
compress
(
dumps
(
d
),
9
))
def
_cb_decode
(
s
):
return
loads
(
decompress
(
unquote
(
s
)))
def
_cb_decode
(
s
,
maxsize
=
8192
):
dec
=
decompressobj
()
data
=
dec
.
decompress
(
unquote
(
s
),
maxsize
)
if
dec
.
unconsumed_tail
:
raise
ValueError
return
loads
(
data
)
def
cookie_path
(
request
):
# Return a "path" value for use in a cookie that refers
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment