- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.2k
Open
Description
Summary
mcp-builder/scripts/evaluation.py line 13 uses xml.etree.ElementTree for parsing evaluation files. While Python 3.13+ blocks external entity expansion by default, defusedxml is recommended for defense in depth and protection against XML entity expansion DoS attacks.
Severity: Low / Informational
Current State
import xml.etree.ElementTree as ETIssue
Python 3.13+ blocks external entities (XXE) by default, preventing file reading and SSRF attacks. However, internal entity expansion remains unprotected, enabling Billion Laughs DoS attacks.
Verified behavior:
- External entities: Blocked (ParseError: undefined entity)
- Internal entity expansion: Works (tested: 4-level nesting expands to 30,000 characters)
Proposed Fix
import defusedxml.ElementTree as ETAdd to requirements:
defusedxml>=0.7.1
Rationale
- Blocks both external entities and internal entity expansion
- Explicit security control independent of Python version defaults
- Minimal code change with comprehensive protection
- Aligns with Python Security and OWASP recommendations
References
Metadata
Metadata
Assignees
Labels
No labels