CVE-2026-41182: LangSmith SDK: Streaming token events bypass output redaction
The LangSmith SDK's output redaction does not cover streaming tokens. With `hideOutputs` (JS) or `hide_outputs` (Python) enabled, each streamed chunk is still stored in the run's events as a `new_token` event with the raw text. Fixed in npm `langsmith` 0.5.19 and pip `langsmith` 0.7.31.
Published Apr 16, 2026 · Updated Apr 24, 2026 · Analysis Oct 30, 2026
What an attacker can do
When an LLM run streams, each chunk is recorded as a new_token event holding the raw token value. The redaction functions, prepareRunCreateOrUpdateInputs in JS and _hide_run_outputs in Python, process only the inputs and outputs of a run. They never touch the events array.
An app that turns on output redaction to keep sensitive model output out of LangSmith therefore still uploads the full streamed answer through the events. Anyone with access to those traces in LangSmith can read it. No attacker action is needed: the data leaks as a side effect of normal tracing.
The impact is confidentiality only, rated low by CVSS. It matters for teams that stream responses containing personal data, secrets or customer content and rely on hide_outputs for compliance. Both SDKs share the pattern: traceable.ts lines 997-1003 and 1044-1050 in JS, and run_helpers.py lines 1924 and 1996 in Python.
Who is affected
npm langsmith 0.5.18 and earlier, and pip langsmith 0.7.30 and earlier. You are exposed if you trace streaming LLM runs and enable hideOutputs or hide_outputs. Check:
npm ls langsmith
pip show langsmithlangsmith
- Ecosystem
- npm
- Affected
- <= 0.5.18
- Fixed in
- 0.5.19
- Check
npm ls langsmith
langsmith
- Ecosystem
- PyPI
- Affected
- <= 0.7.30
- Fixed in
- 0.7.31
- Check
pip show langsmith
How to fix it
Upgrade to npm langsmith 0.5.19 or pip langsmith 0.7.31:
npm install [email protected]
pip install -U "langsmith>=0.7.31"The advisory names no workaround. Traces already uploaded stay in LangSmith with the token events, so review whether you need to delete them.
How to tell if you were hit
Open a streamed run in LangSmith that was traced with redaction on. If its events list shows new_token entries with readable text while inputs and outputs show as hidden, the run leaked. Search your project for runs from before the upgrade with streaming enabled, and check who had access to them.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
The LangSmith SDK's output redaction controls (hideOutputs in JS, hide_outputs in Python) do not apply to streaming token events. When an LLM run produces streaming output, each chunk is recorded as a new_token event containing the raw token value. These events bypass the redaction pipeline entirely — prepareRunCreateOrUpdateInputs (JS) and _hide_run_outputs (Python) only process the inputs and outputs fields on a run, never the events array. As a result, applications relying on output redaction to prevent sensitive LLM output from being stored in LangSmith will still leak the full streamed content via run events.
Details
Both JS and Python SDKs are affected. The same pattern exists in both:
- JS SDK:
traceable.ts:997-1003andtraceable.ts:1044-1050 - Python SDK:
run_helpers.py:1924andrun_helpers.py:1996
In both SDKs, new_token events with raw kwargs.token values are added during streaming, and the redaction pipeline (hideOutputs in JS, hide_outputs in Python) only processes inputs/outputs — never events.
Credited to ryu7eroo.
Questions
- Are non-streaming runs affected?
The advisory only describes streaming token events. Redaction of the
inputsandoutputsfields works as designed.- Which versions fix CVE-2026-41182?
npm
langsmith0.5.19 and piplangsmith0.7.31.- Does this need an attacker to do anything?
No. Raw tokens are sent as part of normal tracing. The exposure is to whoever can view the traces.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More LangSmith SDK vulnerabilities
All LangSmith SDK entriesGHSA-f4xh-w4cj-qxq8
LangSmith SDK TracingMiddleware: Arbitrary server-side file read
high7.7Jun 19, 2026CVE-2026-45134
LangSmith SDK: Public prompt pull deserializes untrusted manifests without trust boundary warning
high7.1May 13, 2026CVE-2026-25528
LangSmith Client SDK Affected by Server-Side Request Forgery via Tracing Header Injection
medium5.8Feb 9, 2026
