Langchain Community Vulnerable to XML External Entity (XXE) Attacks
The EverNoteLoader component in langchain-community parsed XML with external entity references enabled, so a crafted note file could make the parser read local files. An attacker could use this to disclose sensitive files such as the system password file.
langchain-ai/langchain-community
Originally disclosed on huntr
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.
From the GitHub Advisory Database (GHSA-pc6w-59fv-rh23, CC BY 4.0).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The XML parser was used without disabling external entity resolution.
What the attacker needed
Ability to supply a crafted note file
The fix
The issue was fixed in version 0.3.27 of langchain-community.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
XML files can contain special instructions called entities that tell the parser to pull in content from elsewhere. If those instructions are allowed to point at files on the server, an attacker can make the program read and return private files. Here the note-loading code did not switch that feature off.
What is XXE?
An XML parser resolves entities the attacker defines, reading local files or making the server send requests.