LangSmith Tracing Header Injection Turned Observability Metadata into a Data Route
CVE-2026-25528 affected applications that passed untrusted HTTP tracing headers into the LangSmith SDK. A crafted baggage header could add an attacker-controlled replica URL; when a traced operation finished, the SDK sent run data to that destination. Inputs, outputs, and application metadata could therefore leave through a feature intended for observability. The flaw shows that tracing context is active routing authority, not harmless metadata.
Threat Analysis
- The vulnerable condition was untrusted header propagation. Applications were exposed when
TracingMiddlewareaccepted public request headers, or code passed them toRunTree.from_headers()orRunTree.fromHeaders(). Using LangSmith without that path was not enough. - The
baggageheader carried destination authority. An attacker could add a replica object containing anapi_url. Vulnerable SDK versions stored it as tracing configuration, thenpost()andpatch()sent run data to the injected URL after the traced work completed. The same control could target an internal URL as SSRF. - The fix removed unsafe inherited fields. Python versions from 0.4.10 to below 0.6.3 and npm versions from 0.3.41 to below 0.4.6 were affected. Fixed SDKs allowlist safe replica fields and discard caller-controlled destination and credential fields.
- The evidence does not prove a specific secret was stolen. A secret is exposed only if it was present in the exported run. There is currently no public evidence that this method has been used in an actual attack.
Applicable AIDEFEND Defenses (4)
baggage with a strict schema and a safe-field allowlist, reject unknown replica fields, and remove caller-controlled api_url, api_key, or equivalent authority before tracing context is created. This is structured-header validation, not a prompt-injection filter.What Defenders Should Do Now
- Upgrade every Python and TypeScript LangSmith SDK to a current supported release, and verify the version actually loaded in each deployed image or process.
- Find all uses of
TracingMiddleware,RunTree.from_headers(), andRunTree.fromHeaders(). Strip untrustedbaggagefields before those calls, or avoid propagating public request headers into tracing context. - Allow tracing exporters to reach only approved LangSmith endpoints. Block cloud metadata, private management ranges, and arbitrary Internet destinations from the tracing workload.
- Review which prompts, responses, retrieved documents, tool arguments, user identifiers, and secrets enter run data. Redact or suppress fields before export and test fail-closed behavior.
- Search historical egress and trace configuration for unfamiliar replica destinations. Rotate only a specific credential shown by evidence to have appeared in redirected traces.
Conclusion
The defect crossed two boundaries that observability code often blurs: request context decided where data would go, and rich AI run data left the service as routine telemetry. AIDEFEND maps this case to four separate controls: deploy the fixed SDK, remove routing authority from untrusted headers, minimize trace contents before export, and enforce destination policy outside the process. Tracing metadata should describe a request, never grant it a new network route.