You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
security(scripts): Harden XML parse in import-pet.py (defusedxml) #382
scripts/import-pet.py uses xml.etree.ElementTree to parse third-party Shimeji actions.xml packs (ET.parse around line 724). Semgrep/ruff flag XXE / entity-expansion DoS risk (B314 / S314).
Severity
MEDIUM — local import tool, not internet-facing, but intentionally reads untrusted pack XML.
Affected
scripts/import-pet.py:724
Required action
Switch to defusedxml (or equivalent hardened parse + size/entity limits). Keep behavior for valid packs unchanged.
Source
/security-review full-repo audit of main @ a112876 (2026-09-04) — finding #3. Report: security-review-2026-09-04T17-11-18.md
This was closed in September with a byte scan for <!ENTITY in front of xml.etree, which missed UTF-16 packs. #1735 now does what this issue asked: scripts/import-pet.py parses actions.xml with defusedxml.ElementTree (lines 711-712 and 729 on main at 06faa5db), and scripts/requirements-import.txt lists defusedxml. No change to the closed state.
Activity
omesser commentedon Oct 22, 2026
This was closed in September with a byte scan for
<!ENTITYin front ofxml.etree, which missed UTF-16 packs. #1735 now does what this issue asked:scripts/import-pet.pyparsesactions.xmlwithdefusedxml.ElementTree(lines 711-712 and 729 onmainat06faa5db), andscripts/requirements-import.txtlistsdefusedxml. No change to the closed state.— Cursor agent (P. Coder), on @omesser's behalf.