CVE-2026-27795

MEDIUM
Published February 25, 2026
CISO Take

If your LangChain JS applications use RecursiveUrlLoader—common in RAG pipelines and web-scraping agents—upgrade @langchain/community to 1.1.18 immediately. This is a bypass of the prior SSRF patch (CVE-2026-26019), meaning the attack surface was not fully closed; expect the fix history to raise auditor flags. In cloud environments without IMDSv2 enforcement, successful exploitation leads directly to IAM credential exposure.

Severity & Risk

CVSS 3.1
4.1 / 10
EPSS
N/A
KEV Status
Not in KEV
Sophistication
Trivial

Recommended Action

  1. 1) Patch: Upgrade @langchain/community to >=1.1.18 immediately—this is the only complete fix. 2) Cloud hardening (independent control): Enforce IMDSv2 (token-required mode) on all EC2/cloud instances running LangChain; this blocks the metadata endpoint vector even on unpatched versions. 3) Network egress filtering: Restrict outbound HTTP from LangChain processes to known-safe IP ranges; block RFC1918 and link-local (169.254.0.0/16) ranges at the network layer. 4) Audit: Grep codebase for 'RecursiveUrlLoader' usage and trace all URL input paths to identify user-controllable trust boundaries. 5) Detection: Alert on outbound requests to 169.254.169.254, 100.100.100.200 (Alibaba Cloud), or internal RFC1918 targets originating from LangChain container/process network namespaces. 6) Verify no prior exploitation: Review cloud access logs for unusual IAM credential usage or metadata service calls from LangChain hosts.

Classification

Compliance Impact

This CVE is relevant to:

EU AI Act
Art. 15 - Accuracy, robustness and cybersecurity Article 15 - Accuracy, robustness and cybersecurity
ISO 42001
A.9.3 - AI system inputs
NIST AI RMF
GOVERN-1.7 - Processes for identifying and addressing AI risks MANAGE-2.2 - Risk treatment for AI system vulnerabilities
OWASP LLM Top 10
LLM06 - Sensitive Information Disclosure LLM07 - Insecure Plugin Design

Technical Details

NVD Description

LangChain is a framework for building LLM-powered applications. Prior to version 1.1.8, a redirect-based Server-Side Request Forgery (SSRF) bypass exists in `RecursiveUrlLoader` in `@langchain/community`. The loader validates the initial URL but allows the underlying fetch to follow redirects automatically, which permits a transition from a safe public URL to an internal or metadata endpoint without revalidation. This is a bypass of the SSRF protections introduced in 1.1.14 (CVE-2026-26019). Users should upgrade to `@langchain/community` 1.1.18, which validates every redirect hop by disabling automatic redirects and re-validating `Location` targets before following them. In this version, automatic redirects are disabled (`redirect: "manual"`), each 3xx `Location` is resolved and validated with `validateSafeUrl()` before the next request, and a maximum redirect limit prevents infinite loops.

Exploitation Scenario

An attacker with authenticated access to a LangChain-based research agent or RAG pipeline submits a request containing a URL pointing to their controlled server (which passes RecursiveUrlLoader's initial URL validation). The attacker's server responds with an HTTP 301 redirect to http://169.254.169.254/latest/meta-data/iam/security-credentials/. On versions 1.1.14–1.1.17, the loader follows the redirect without revalidating the Location header. The metadata endpoint returns IAM role credentials as plain text, which the loader ingests as a document. Depending on application design, these credentials may be passed to the LLM as context, stored in the RAG vector database, or surfaced in API responses. The attacker retrieves the credentials and uses them to access AWS resources—S3 buckets, Secrets Manager, or RDS—outside the application's intended scope.

Weaknesses (CWE)

CVSS Vector

CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:N/A:N

References

Timeline

Published
February 25, 2026
Last Modified
February 27, 2026
First Seen
February 25, 2026