CVE-2025-68463
📋 TL;DR
This vulnerability in Biopython's Bio.Entrez module allows XML External Entity (XXE) attacks through improper restriction of XML doctype declarations. It affects applications that process untrusted XML data using Bio.Entrez, potentially allowing attackers to read local files or conduct server-side request forgery. Users of Biopython who process XML from untrusted sources are at risk.
💻 Affected Systems
- Biopython
⚠️ Manual Verification Required
This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.
Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).
🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.
- Review the CVE details at NVD
- Check vendor security advisories for your specific version
- Test if the vulnerability is exploitable in your environment
- Consider updating to the latest version as a precaution
⚠️ Risk & Real-World Impact
Worst Case
An attacker could read sensitive local files (including configuration files, credentials), conduct server-side request forgery to internal systems, or cause denial of service through entity expansion attacks.
Likely Case
Local file disclosure from the server where Biopython is running, potentially exposing configuration files, API keys, or other sensitive data accessible to the application.
If Mitigated
Limited impact if XML input is properly validated and sanitized before processing, or if the application runs with minimal file system permissions.
🎯 Exploit Status
XXE vulnerabilities are well-understood with established exploitation techniques. The GitHub issue includes proof-of-concept examples showing file disclosure.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.87 or later
Vendor Advisory: https://github.com/biopython/biopython/issues/5109
Restart Required: No
Instructions:
1. Upgrade Biopython to version 1.87 or later using pip: pip install --upgrade biopython
2. Verify the upgrade completed successfully
3. No application restart required for Python applications
🔧 Temporary Workarounds
Disable XML external entities
allConfigure XML parser to disable external entity resolution before parsing untrusted XML
# In Python code using Bio.Entrez:
# Set defusedxml=True when creating parser
# Or configure underlying XML parser with:
# parser = XMLParser(resolve_entities=False, no_network=True)
Input validation and sanitization
allValidate and sanitize XML input before processing with Bio.Entrez
# Remove DOCTYPE declarations from untrusted XML
import re
safe_xml = re.sub(r'<!DOCTYPE[^>[]*(\[[^]]*\])?>', '', untrusted_xml)
🧯 If You Can't Patch
- Implement strict input validation to reject XML containing DOCTYPE declarations
- Run application with minimal file system permissions to limit file disclosure impact
🔍 How to Verify
Check if Vulnerable:
Check Biopython version: python -c "import Bio; print(Bio.__version__)" - if version is 1.86 or earlier, the system is vulnerable if using Bio.Entrez XML parsing.
Check Version:
python -c "import Bio; print(Bio.__version__)"
Verify Fix Applied:
After upgrade, verify version is 1.87 or later: python -c "import Bio; print(Bio.__version__)" and test with known XXE payloads to confirm they are rejected.
📡 Detection & Monitoring
Log Indicators:
- XML parsing errors with DOCTYPE declarations
- Unexpected file read operations from XML parsing context
- Outbound HTTP requests from XML parser to internal/external systems
Network Indicators:
- XML payloads containing DOCTYPE declarations with external entity references
- HTTP requests to internal systems originating from application server
SIEM Query:
source="application_logs" AND ("DOCTYPE" OR "ENTITY" OR "SYSTEM") AND "Bio.Entrez"