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
a5fa5771
Commit
a5fa5771
authored
Oct 01, 2005
by
Jens Vagelpohl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Collector #1863: Prevent possibly sensitive information to leak via
the TransientObject's __repr__ method.
parent
e117fb70
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
doc/CHANGES.txt
doc/CHANGES.txt
+3
-0
lib/python/Products/Transience/TransientObject.py
lib/python/Products/Transience/TransientObject.py
+2
-2
lib/python/Products/Transience/tests/testTransientObject.py
lib/python/Products/Transience/tests/testTransientObject.py
+8
-0
No files found.
doc/CHANGES.txt
View file @
a5fa5771
...
...
@@ -31,6 +31,9 @@ Zope Changes
Bugs Fixed
- Collector #1863: Prevent possibly sensitive information to leak via
the TransientObject's __repr__ method.
- Repaired 'handle_errors' usage for doctests, along with the
supporting 'debug' argument passed to
'ZPublisher.Test.publish_module'.
...
...
lib/python/Products/Transience/TransientObject.py
View file @
a5fa5771
...
...
@@ -256,8 +256,8 @@ class TransientObject(Persistent, Implicit):
return
"%s%s"
%
(
t
,
d
)
def
__repr__
(
self
):
return
"id: %s, token: %s, contents: %s"
%
(
self
.
id
,
self
.
token
,
`self.
item
s()`
return
"id: %s, token: %s, contents
keys
: %s"
%
(
self
.
id
,
self
.
token
,
`self.
key
s()`
)
def
lastmodified_sort
(
d1
,
d2
):
...
...
lib/python/Products/Transience/tests/testTransientObject.py
View file @
a5fa5771
...
...
@@ -115,6 +115,14 @@ class TestTransientObject(TestCase):
t
.
delete
(
'foobie'
)
self
.
assertEqual
(
t
.
get
(
'foobie'
),
None
)
def
test_repr_leaking_information
(
self
):
# __repr__ used to show all contents, which could lead to sensitive
# information being visible in e.g. the ErrorLog object.
t
=
self
.
t
.
new
(
'password-storing-session'
)
t
.
set
(
'__ac_password__'
,
'secret'
)
self
.
failIf
(
repr
(
t
).
find
(
'secret'
)
!=
-
1
,
'__repr__ leaks: %s'
%
repr
(
t
)
)
def
test_suite
():
testsuite
=
makeSuite
(
TestTransientObject
,
'test'
)
...
...
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