Vulnerabilities/

LangChain serialization injection vulnerability enables secret extraction

Severity:
High

Description

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.

Recommendation

Update the langchain package to the latest compatible version. Followings are version details:

References

Related Issues

Tags:
npm
langchain
Anything's wrong? Let us know Last updated on December 24, 2025