[Security] Incomplete defusedxml migration — XML parsing still uses unsafe stdlib in 4 files #37
Labels
No labels
blocked:children
blocked:depends-101
blocked:depends-103
blocked:depends-104
blocked:needs-attention
blocked:needs-decision
blocked:no-changes
blocked:preflight
bug
chore
feature-request
in-progress
lint-cleanup
needs-decompose
performance
quality
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/easystitch#37
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Regression of #20
Issue #20 ("[Security] MEDIUM: 17 Python security issue(s)") was closed with
the claim that
defusedxmlreplacedxml.etree.ElementTree. The fix commit(
cd5e9f1) patchedsrc/intent_resolver/dom_resolver.pybut missed fourother files that still use the unsafe import.
Bandit re-scan (today, against current
main)All four parse user-supplied SVG / config XML. This is the exact attack
surface that
defusedxmlexists to mitigate (XXE, billion-laughs, etc.).Impact
When the HTTP service (per "Add HTTP service layer" issue) starts ingesting
SVG from network callers, every request that hits the SVG annotation
pipeline is exposed to the XML vulnerabilities that
defusedxmlwassupposed to close.
Fix
Replace
import xml.etree.ElementTree as ETwithfrom defusedxml import ElementTree as ETin all four files. Auditremaining
ET.parse,ET.fromstring,ET.iterparse,ET.XMLParsercalls to make sure they all use the defusedxml-backed versions.
Add a pre-commit
banditcheck that fails on any newimport xml.etree.ElementTreeinsrc/.Acceptance
bandit -r src/reports zeroB405/B314findings.