AgentbeamBeta
AI agent vulnerability · LangChain

CVE-2025-6984: Langchain Community Vulnerable to XML External Entity (XXE) Attacks

highCVSS 3.0 7.5GHSA-pc6w-59fv-rh23

langchain-community before 0.3.27 parses Evernote export files in EverNoteLoader with lxml's iterparse and leaves external entities enabled. A crafted ENEX file can pull local files such as /etc/passwd into the loaded document text. Applications that load untrusted Evernote exports are affected. Fixed in 0.3.27.

Published Sep 4, 2025 · Updated Sep 5, 2025 · Analysis Nov 9, 2026

What an attacker can do

EverNoteLoader reads .enex files, which are XML. Its _parse_note_xml method called etree.iterparse() with options that allowed entity resolution, and also with recover and huge_tree turned on. A file that declares an external entity pointing at a local path, and then references that entity in a note, makes the parser read the target file and put its content into the note text.

The attacker must get a malicious ENEX file into a pipeline that loads it. That fits RAG ingestion tools and document-import features where users upload their own Evernote exports. What the loader returns becomes document content, which may flow into an index, a prompt or a response, so the attacker can read it back. The advisory scores confidentiality high and calls out files like /etc/passwd. The same read can reach application config files and secrets that the process can open.

The flaw does not need credentials on the machine, only the ability to supply the file. Applications that load only Evernote exports you made yourself have little exposure.

Who is affected

langchain-community before 0.3.27, for code that uses EverNoteLoader on files from sources you do not control. Check the version:

pip show langchain-community

Search your code for EverNoteLoader and document_loaders.evernote, and look at where the .enex files come from.

langchain-community

Ecosystem
PyPI
Affected
< 0.3.27
Fixed in
0.3.27
Check
pip show langchain-community

How to fix it

Upgrade to 0.3.27:

pip install --upgrade "langchain-community>=0.3.27"

The fix is commit e842452108089524e22c3a2ced851c021884556f, "Prevent XXE in evernote loader". It sets resolve_entities=False and no_network=True on the iterparse call, turns recover and huge_tree off, and drops strip_cdata=False. As a side effect, malformed ENEX files now raise errors instead of being repaired, and files that rely on entities such as &nbsp; may fail to parse. The advisory lists no workaround; until you upgrade, avoid loading untrusted ENEX files.

How to tell if you were hit

Look for uploaded .enex files that contain a DOCTYPE with ENTITY declarations or SYSTEM identifiers such as file:///etc/passwd. Check loaded document text for content that looks like system files. Watch for the loader process opening files outside the upload folder, and for outbound requests it makes while parsing. After the upgrade, such files fail with a parse error.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

The langchain-ai/langchain project, specifically the EverNoteLoader component, is vulnerable to XML External Entity (XXE) attacks due to insecure XML parsing. The vulnerability arises from the use of etree.iterparse() without disabling external entity references, which can lead to sensitive information disclosure. An attacker could exploit this by crafting a malicious XML payload that references local files, potentially exposing sensitive data such as /etc/passwd. This issue has been fixed in 0.3.27 of langchain-community.

Questions

Which langchain-community version fixes CVE-2025-6984?

0.3.27. Earlier versions parse ENEX files with external entities enabled.

Does it affect all LangChain document loaders?

No. The advisory names the EverNoteLoader component. Other loaders are not covered by this entry.

Can the fix break my Evernote imports?

It can. The patch turns recovery off, so malformed ENEX files raise errors, and files using entities like &nbsp; may fail to parse.

Is it exploited in the wild?

No source we read reports exploitation, and the entry has no CISA KEV record.

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 LangChain vulnerabilities

All LangChain entries