Skip to content

security(scripts): Harden XML parse in import-pet.py (defusedxml) #382

Closed

Description

@omesser

Summary

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

Activity

  1. added
    needs-triageMaintainer needs to evaluate this issue
    securitySecurity related - secrets, password, key-chain management, etc
    on Sep 5, 2026
  2. moved this from Todo to In Progress in Fidgeton Sep 6, 2026
  3. moved this from In Progress to Done in Fidgeton Sep 6, 2026
  4. added this to the V1 milestone on Sep 6, 2026
  5. omesser commented on Oct 22, 2026

    @omesser
    OwnerAuthor

    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.

    — Cursor agent (P. Coder), on @omesser's behalf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageMaintainer needs to evaluate this issuesecuritySecurity related - secrets, password, key-chain management, etc

    Projects

    • Status
      Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions