Biopython, doctype XML external entity (XXE) injection, Moderate severity

Listen to this Post

The vulnerability in Biopython’s Bio.Entrez module through version 1.86 involves improper handling of XML external entities (XXE) during XML parsing. When Bio.Entrez retrieves data from NCBI Entrez databases, it processes XML responses using Python’s XML parsing libraries. In affected versions, the XML parser is configured without disabling external entity resolution, specifically allowing doctype declarations. An attacker can craft a malicious XML response containing a doctype that defines an external entity with a file path or URL. When this XML is parsed by Bio.Entrez, the parser resolves the external entity, leading to unauthorized access to local files on the server, potential denial of service, or server-side request forgery (SSRF). This occurs because the default XML parsing settings do not restrict DTDs or external entities. The vulnerability is triggered when using functions like `efetch()` or `esummary()` with attacker-controlled input, such as manipulated server responses or local XML files. The XXE injection allows reading sensitive files like `/etc/passwd` by referencing entities in the XML content. The issue stems from the use of `xml.dom.minidom` or similar parsers without setting `resolve_entities` to false or using secure parsing options. This flaw enables data exfiltration and system compromise in applications that use Biopython to process untrusted XML data from Entrez or other sources.
Platform: Biopython
Version: through 1.86
Vulnerability: doctype XXE injection
Severity: Moderate
date: Dec 18 2025

Prediction: Patch TBD

What Undercode Say:

Analytics

!/bin/bash

Check Biopython version

python -c “import Bio; print(Bio.__version__)”

Test for XXE vulnerability

curl -X POST -d @exploit.xml http://localhost/entrez

Sample vulnerable Python code

from Bio import Entrez

Entrez.email = “[email protected]

handle = Entrez.efetch(db=”nucleotide”, id=”malicious_id”)

exploit.xml content

]>

&xxe;

How Exploit:

Craft malicious XML with doctype referencing local files, inject via Bio.Entrez requests, extract sensitive data through parsed entities.

Protection from this CVE

Disable external entities in XML parsers, use defusedxml library, upgrade Biopython when patched, sanitize all XML inputs.

Impact:

Local file disclosure, denial of service, potential server compromise, data exfiltration from affected systems.

🎯Let’s Practice Exploiting & Learn Patching For Free:

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top