Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
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 applicationsUpgrade cupy
to version 11.5.0, 12.0.0b3 or higher.
Affected versions of this package are vulnerable to Race Condition due to missing checks in jitify.pyx
file. This issue allows an attacker to interfere with processes leading to unintended behaviour.
$ export CUPY_CACHE_IN_MEMORY=1
$ ./test.py 10
import sys
import threading
import cupy
def run():
kern = cupy.RawKernel(code='''
#include <cupy/cuda_workaround.h>
#include <cupy/cub/cub/block/block_reduce.cuh>
#include <cupy/cub/cub/block/block_load.cuh>
extern "C" __global__ void mykernel() {}''', name='mykernel', jitify=True)
kern.compile()
threads = []
for i in range(int(sys.argv[1])):
threads.append(threading.Thread(target=run))
for t in threads:
t.start()
for t in threads:
t.join()