Summary
A URL parameter injection flaw in LangSmith Studio allowed an attacker to craft links that caused bearer tokens and user/workspace identifiers to be sent to attacker-controlled servers.
When authenticated users clicked these malicious URLs, the leaked short‑lived tokens could be used to impersonate them and access any LangSmith resources or actions they were authorized to perform within their workspace.
Affected context
The vulnerability occurs in LangSmith Studio deployments (both LangSmith Cloud and self-hosted) that accept a configurable baseUrl or similar URL parameter influencing where authentication tokens are sent.
It becomes relevant when:
- Users are already authenticated in LangSmith Studio
- The application reflects or uses URL parameters to construct redirect or callback URLs
- There is no strict origin or domain validation on those parameters
Under these conditions, a crafted link can cause the browser to transmit bearer tokens to an attacker-controlled server.
Exploit preconditions
- Attack surface: LangSmith Studio web interface accessed via browser.
- Required access:
- Attacker must be able to send links to targets (e.g., via email, chat, ticketing systems).
- Victim must be an authenticated LangSmith user in a valid session or willing to log in after following the link.
- Trigger point: Victim clicks a specially crafted URL that injects malicious values into the
baseUrlor related parameter used by LangSmith Studio. - Why exploitation is possible:
- The application trusted user-controlled URL parameters when constructing network requests or redirects that included authentication credentials.
- Lack of strict validation or allow-listing of allowed origins permitted tokens and IDs to be transmitted to attacker-controlled endpoints.
Why this happens
This issue stems from improper neutralization of user-controlled URL parameters that influence where authentication data is sent, aligning with CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component.
The application treated the baseUrl (or similar parameter) as trustworthy and allowed it to shape outbound requests or redirects involving bearer tokens.
Instead of constraining this parameter to a fixed set of trusted origins or validating it against a strict allow-list, it was used directly, enabling attackers to inject an arbitrary external URL that became the destination for sensitive authentication information.
Potential impact
- Attackers may obtain short-lived bearer tokens, user IDs, and workspace IDs.
- Compromise of LangSmith accounts within the token's validity window.
- Unauthorized access to LangSmith projects, datasets, traces, and configuration within the victim's workspace.
- Execution of any action the victim is authorized to perform (e.g., modifying settings, viewing or altering artifacts).
- Potential pivot into broader organizational environments if LangSmith data or configuration is sensitive or integrated with other systems.
General mitigation guidance
Effective mitigation focuses on constraining how URL parameters influence security-sensitive endpoints and ensuring tokens are only ever sent to trusted origins.
Recommended patterns include:
- Strict origin allow-listing: Treat parameters that affect redirect targets or base URLs as untrusted; validate them against a server-side list of permitted domains or exact URLs.
- Separation of concerns: Do not allow user-controlled parameters to directly dictate where authentication-bearing requests are sent; keep authentication flows bound to server-defined endpoints.
- Token scoping and minimization: Use tokens with least privilege and minimal lifetime; avoid sending them in contexts where the destination is not fully controlled.
- Safe URL construction APIs: Use framework utilities that enforce origin constraints or canonicalization rather than string concatenation for redirects and API destinations.
- Defense-in-depth on clients: Where possible, leverage browser security mechanisms such as Content Security Policy (CSP) and same-site cookie attributes so that even if a parameter is abused, credentials are harder to exfiltrate.
How teams detect issues like this
Detection should focus on both code-level patterns and runtime behaviors indicative of parameter-driven URL manipulation:
- Static analysis signals:
- Uses of request/response APIs that build URLs from query parameters or route parameters (e.g.,
redirect(param),fetch(baseUrl + ...)). - Flows where authentication tokens, authorization headers, or session identifiers are attached to requests whose destination is partly user-controlled.
- Missing validation or allow-list checks on parameters that set origins, domains, or
baseUrl-style configuration. - Code review focus areas:
- Review all places where LangSmith Studio or similar apps derive external endpoints from URL parameters or configuration fields supplied by the user.
- Check that URL parsing and normalization are performed server-side, and that only explicitly allowed hosts are used for network calls involving credentials.
- Runtime and logging strategies:
- Monitor logs for requests that send authentication tokens or headers to domains outside the expected set of organization-controlled hosts.
- Alert on unusual
baseUrlor redirect parameter values that reference external or suspicious domains.
Automated SAST/DAST tools can augment manual review by flagging dynamic redirect patterns and unvalidated URL parameter usage, but should be complemented with targeted security code reviews for authentication flows.

