Skip to content
Heist/ feed
Back to feed
High

LangChain serialization injection vulnerability enables secret extraction

Type: advisorySources: OSV

LangChain is a framework for building LLM-powered applications. Prior to @langchain/core versions 0.3.80 and 1.1.8, and prior to langchain versions 0.3.37 and 1.2.3, a serialization injection vulnerability exists in LangChain JS's toJSON() method (and subsequently when string-ifying objects using JSON.stringify(). The method did not escape objects with 'lc' keys when serializing free-form data in kwargs. The 'lc' key is used internally by LangChain to mark serialized objects. When user-controlled data contains this key structure, it is treated as a legitimate LangChain object during deserialization rather than plain user data. This issue has been patched in @langchain/core versions 0.3.80 and 1.1.8, and langchain versions 0.3.37 and 1.2.3

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2025-68665
Confirmed fixed CVEs
Not specified
Updated in this feed
8 Nov 2026, 02:29 UTC · Revision 1

Source evidence

LangChain serialization injection vulnerability enables secret extraction

core-osv · Original source

Published 23 Dec 2025, 22:56 UTC

LangChain is a framework for building LLM-powered applications. Prior to @langchain/core versions 0.3.80 and 1.1.8, and prior to langchain versions 0.3.37 and 1.2.3, a serialization injection vulnerability exists in LangChain JS's toJSON() method (and subsequently when string-ifying objects using JSON.stringify(). The method did not escape objects with 'lc' keys when serializing free-form data in kwargs. The 'lc' key is used internally by LangChain to mark serialized objects. When user-controlled data contains this key structure, it is treated as a legitimate LangChain object during deserialization rather than plain user data. This issue has been patched in @langchain/core versions 0.3.80 and 1.1.8, and langchain versions 0.3.37 and 1.2.3

osv:CVE-2025-68665
Complete source record
{
  "id": "d7254f40e0ae9ea969165b3e3b6fdfba33483b9e05c51b5cb0b602a08b2ea6c1",
  "url": "https://osv.dev/vulnerability/CVE-2025-68665",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "LangChain serialization injection vulnerability enables secret extraction",
    "summary": "LangChain is a framework for building LLM-powered applications. Prior to @langchain/core versions 0.3.80 and 1.1.8, and prior to langchain versions 0.3.37 and 1.2.3, a serialization injection vulnerability exists in LangChain JS's toJSON() method (and subsequently when string-ifying objects using JSON.stringify(). The method did not escape objects with 'lc' keys when serializing free-form data in kwargs. The 'lc' key is used internally by LangChain to mark serialized objects. When user-controlled data contains this key structure, it is treated as a legitimate LangChain object during deserialization rather than plain user data. This issue has been patched in @langchain/core versions 0.3.80 and 1.1.8, and langchain versions 0.3.37 and 1.2.3",
    "evidence": "osv:CVE-2025-68665",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2025-68665",
      "aliases": [
        "CVE-2025-68665",
        "GHSA-r399-636x-v7f6"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/langchain-ai/langchainjs",
              "type": "GIT",
              "events": [
                {
                  "introduced": "2954498b052b3ebc30b8ff37a11db1953f4ae0f0"
                },
                {
                  "fixed": "e5063f9c6e9989ea067dfdff39262b9e7b6aba62"
                },
                {
                  "fixed": "de32b32b0b4bbd4ce2445e3044dd8011b3a78b30"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "@langchain/core < 0.3.80"
                      },
                      {
                        "last_affected": "@langchain/core < 0.3.80"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandaloneSingleVersion"
                  },
                  {
                    "range": [
                      {
                        "fixed": "e5063f9c6e9989ea067dfdff39262b9e7b6aba62"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "de32b32b0b4bbd4ce2445e3044dd8011b3a78b30"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "langchain@1.2.3"
                  }
                ]
              }
            }
          ],
          "versions": [
            "@langchain/core < 0.3.80"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-68665.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:52.765482402Z",
      "provider": "osv",
      "references": [
        "https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain%2Fcore%401.1.8",
        "https://github.com/langchain-ai/langchainjs/releases/tag/langchain%401.2.3",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/68xxx/CVE-2025-68665.json",
        "https://github.com/langchain-ai/langchainjs/security/advisories/GHSA-r399-636x-v7f6",
        "https://nvd.nist.gov/vuln/detail/CVE-2025-68665",
        "https://github.com/langchain-ai/langchainjs/commit/e5063f9c6e9989ea067dfdff39262b9e7b6aba62"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-502"
        ],
        "cna_assigner": "GitHub_M",
        "unresolved_ranges": [
          {
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "@langchain/core >= 1.0.0, < 1.1.8"
                  },
                  {
                    "last_affected": "@langchain/core >= 1.0.0, < 1.1.8"
                  },
                  {
                    "introduced": "langchain >= 1.0.0, < 1.2.3"
                  },
                  {
                    "last_affected": "langchain >= 1.0.0, < 1.2.3"
                  },
                  {
                    "introduced": "langchain < 0.3.37"
                  },
                  {
                    "last_affected": "langchain < 0.3.37"
                  }
                ],
                "source": "AFFECTED_FIELD",
                "strategy": "StandaloneSingleVersion"
              }
            ]
          }
        ],
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/68xxx/CVE-2025-68665.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2025-68665",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 521795,
  "published_at": "2025-12-23T22:56:04.837+00:00"
}