PyPI / defusedxml / 0.7.1

defusedxml 0.7.1

Source
https://github.com/tiran/defusedxml
Tag scanned
v0.7.1
Compared with
v0.7.0 (0 signals introduced since)
Files
22 scanned, 23 skipped (binary, oversized, or unrecognised)
Signals
0 critical · 0 warn · 1 info
Scan time
3.2 s
LLM review
Reviewed by claude-haiku-5-5 (Anthropic): 1 of 1 warn and critical signal; 1 demoted to info.
Disclude version
4.1.0
Scanned (UTC)
2026-10-22 03:28

Signals

Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.

  1. info critical → info by review dynamic-import defusedxml/common.py:78:5

    `__import__` called on a non-literal expression (ast pass, confidence 0.70)

        stdlib_name = defused_mod.__origin__
        __import__(stdlib_name, {}, {}, ["*"])
        stdlib_mod = sys.modules[stdlib_name]
        stdlib_names = set(dir(stdlib_mod))
    likely benign LLM, confidence 0.90 defusedxml's internal helper that dynamically imports the wrapped stdlib XML module by its stored origin name.
    Reasoning

    The stdlib name comes from `defused_mod.__origin__`, a module attribute set by the package itself, and the code then reads the same module back from sys.modules to collect its names. This is a standard compatibility pattern for wrapping stdlib XML modules, not an attacker-controlled import. The finding is a critical AST dynamic-import hit, but the snippet shows nothing that is hidden, encoded, or fed by external input.

Reproduce This Scan

Run disclude locally to verify. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.

cargo install disclude --version 4.1.0
git clone https://github.com/tiran/defusedxml defusedxml && cd defusedxml
git checkout v0.7.1
disclude scan --severity info --diff v0.7.0 .