VAITP Dataset

← Back to the dataset

CVE-2026-45134

LangSmith SDKs may execute arbitrary code via untrusted public prompts.

  • CVSS 7.1
  • CWE-502
  • Input Validation and Sanitization
  • Remote

LangSmith Client SDKs provide SDK's for interacting with the LangSmith platform. Prior to LangSmith SDK Python 0.8.0 and JS/TS 0.6.0, the LangSmith SDK's prompt pull methods (pull_prompt / pull_prompt_commit in Python, pullPrompt / pullPromptCommit in JS/TS) fetch and deserialize prompt manifests from the LangSmith Hub. These manifests may contain serialized LangChain objects and model configuration that affect runtime behavior. When pulling a public prompt by owner/name identifier, the manifest content is controlled by an external party, but prior versions of the SDK did not distinguish this from pulling a prompt within the caller's own organization. This vulnerability is fixed in LangSmith SDK Python 0.8.0 and JS/TS 0.6.0.

CVSS base score
7.1
Published
2026-05-27
OWASP
A08 Software and Data Integrity Failures
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Input Validation and Sanitization
Subcategory
Insecure Parsing or Deserialization
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
LangSmith Cl
Fixed by upgrading
Yes

Solution

Upgrade LangSmith SDK for Python to version 0.8.0 or later and for JS/TS to version 0.6.0 or later.

Vulnerable code sample

from langchain.smith import pull_prompt

# In vulnerable versions (<0.8.0), this call fetches a public prompt
# from the "hwchase17" owner on the LangSmith Hub. The manifest for this
# prompt is controlled by an external party, but it is deserialized
# and loaded by the SDK as if it were from a trusted source.
# An attacker could host a malicious prompt manifest that, when deserialized,
# could lead to unintended runtime behavior or remote code execution.
prompt = pull_prompt("hwchase17/openai-functions-agent")

Patched code sample

import json
from typing import Any, Dict

def _is_public_prompt(prompt_identifier: str) -> bool:
    """
    Checks if a prompt identifier refers to a public prompt by looking for
    the 'owner/name' format. This is the key to identifying potentially
    untrusted content from an external party.
    """
    return "/" in prompt_identifier

def fixed_langsmith_pull_deserializer(
    prompt_identifier: str, manifest_data: bytes
) -> Dict[str, Any]:
    """
    This function provides a conceptual representation of the fix for
    CVE-2026-45134 in the LangSmith Python SDK.

    The vulnerability was that manifests from public prompts were deserialized
    with a method that could execute arbitrary code. The fix is to
    differentiate public prompts and parse them using a safe method.
    """
    # THE FIX:
    # Before deserializing, check if the prompt is from a public, untrusted source.
    if _is_public_prompt(prompt_identifier):
        # If the prompt is public, strictly use a safe deserializer like
        # json.loads. This prevents malicious, non-JSON payloads (such as a
        # pickled object) from being processed and executed.
        try:
            return json.loads(manifest_data)
        except json.JSONDecodeError as e:
            # By rejecting any manifest that is not valid JSON, the attack
            # vector of using an alternative, unsafe serialization format is closed.
            raise ValueError(
                "Public prompt manifests must be valid JSON."
            ) from e
    else:
        # For private prompts (within the user's own organization), the
        # source is considered trusted. A robust modern implementation would
        # likely use a safe deserializer here as well for defense-in-depth.
        return json.loads(manifest_data)

Payload

{
  "lc": 1,
  "type": "constructor",
  "id": [
    "langchain_core",
    "load",
    "load_from_serialized"
  ],
  "kwargs": {
    "serialized": {
      "lc": 1,
      "type": "bytes",
      "repr": "gASVBwAAAAAAAACMCF9fbWFpbl9flIwDUkNFlJOUjApyZWR1Y2WUhZR9lCiMBXBvc5SMCnN5c3RlbZSTlIwNdG91Y2ggL3RtcC9wd25lZJSTlEGFlFKULg=="
    }
  }
}

Cite this entry

@misc{vaitp:cve202645134,
  title        = {{LangSmith SDKs may execute arbitrary code via untrusted public prompts.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-45134},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-45134/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::