sqlmapproject/sqlmap · error · ValueError
XML entities are forbidden
Error message
XML entities are forbidden
What it means
Security hardening sentinel: lib/core/patch.py replaces xml.etree.ElementTree.parse with _safe_parse, and this ValueError fires whenever the parsed XML document contains entity definitions (DOCTYPE/entities), blocking XXE attacks against sqlmap's own XML files.
Solutions
- Remove DOCTYPE/entity declarations from the XML being parsed
- Provide entity-free XML input
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at lib/core/patch.py:172 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26).
Data as JSON: /api/errors/87ed12d09d107f1a.
Report an issue: GitHub.
Appendix: source
Thrown at lib/core/patch.py:172
logging._acquireLock = _acquireLock
if not hasattr(logging, "_releaseLock"):
def _releaseLock():
if logging._lock:
logging._lock.release()
logging._releaseLock = _releaseLock
from xml.etree import ElementTree as et
if not getattr(et, "_patched", False):
_real_parse = et.parse
def _safe_parse(source, parser=None):
if parser is None:
parser = et.XMLParser()
if hasattr(parser, "parser"):
def reject(*args): raise ValueError("XML entities are forbidden")
parser.parser.EntityDeclHandler = reject
parser.parser.UnparsedEntityDeclHandler = reject
return _real_parse(source, parser=parser)
et.parse = _safe_parse
et._patched = True
try:
import builtins
except ImportError:
import __builtin__ as builtins
if "enumerate" in difflib.__dict__ and difflib.enumerate is not builtins.enumerate:
difflib.enumerate = builtins.enumerate
def resolveCrossReferences():
"""View on GitHub (pinned to 0a35b20e39)