Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
c7690401
Kaydet (Commit)
c7690401
authored
Şub 15, 2015
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #22885: Fixed arbitrary code execution vulnerability in the dumbdbm
module. Original patch by Claudiu Popa.
üst
eab2fd10
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
dumbdbm.py
Lib/dumbdbm.py
+2
-1
test_dumbdbm.py
Lib/test/test_dumbdbm.py
+8
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/dumbdbm.py
Dosyayı görüntüle @
c7690401
...
@@ -21,6 +21,7 @@ is read when the database is opened, and some updates rewrite the whole index)
...
@@ -21,6 +21,7 @@ is read when the database is opened, and some updates rewrite the whole index)
"""
"""
import
ast
as
_ast
import
os
as
_os
import
os
as
_os
import
__builtin__
import
__builtin__
import
UserDict
import
UserDict
...
@@ -85,7 +86,7 @@ class _Database(UserDict.DictMixin):
...
@@ -85,7 +86,7 @@ class _Database(UserDict.DictMixin):
with
f
:
with
f
:
for
line
in
f
:
for
line
in
f
:
line
=
line
.
rstrip
()
line
=
line
.
rstrip
()
key
,
pos_and_siz_pair
=
eval
(
line
)
key
,
pos_and_siz_pair
=
_ast
.
literal_
eval
(
line
)
self
.
_index
[
key
]
=
pos_and_siz_pair
self
.
_index
[
key
]
=
pos_and_siz_pair
# Write the index dict to the directory file. The original directory
# Write the index dict to the directory file. The original directory
...
...
Lib/test/test_dumbdbm.py
Dosyayı görüntüle @
c7690401
...
@@ -160,6 +160,14 @@ class DumbDBMTestCase(unittest.TestCase):
...
@@ -160,6 +160,14 @@ class DumbDBMTestCase(unittest.TestCase):
self
.
assertEqual
(
expected
,
got
)
self
.
assertEqual
(
expected
,
got
)
f
.
close
()
f
.
close
()
def
test_eval
(
self
):
with
open
(
_fname
+
'.dir'
,
'w'
)
as
stream
:
stream
.
write
(
"str(__import__('sys').stdout.write('Hacked!')), 0
\n
"
)
with
test_support
.
captured_stdout
()
as
stdout
:
with
self
.
assertRaises
(
ValueError
):
dumbdbm
.
open
(
_fname
)
.
close
()
self
.
assertEqual
(
stdout
.
getvalue
(),
''
)
def
tearDown
(
self
):
def
tearDown
(
self
):
_delete_files
()
_delete_files
()
...
...
Misc/NEWS
Dosyayı görüntüle @
c7690401
...
@@ -18,6 +18,9 @@ Core and Builtins
...
@@ -18,6 +18,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #22885: Fixed arbitrary code execution vulnerability in the dumbdbm
module. Original patch by Claudiu Popa.
- Issue #21849: Fixed xmlrpclib serialization of non-ASCII unicode strings in
- Issue #21849: Fixed xmlrpclib serialization of non-ASCII unicode strings in
the multiprocessing module.
the multiprocessing module.
...
...
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