PyPI / attrs / 26.1.0

attrs 26.1.0

Source
https://github.com/python-attrs/attrs
Artifact scanned
attrs-26.1.0-py3-none-any.whl (wheel · 66.0 KB · SHA-256 c647aa4a12df…)
Compared with
attrs-25.4.0-py3-none-any.whl (0 signals introduced since)
Files
29 scanned, 6 skipped (binary, oversized, or unrecognised)
Signals
0 critical · 0 warn · 3 info
Scan time
4.6 s
LLM review
Reviewed by claude-haiku-5-5 (Anthropic): 3 of 3 warn and critical signals; 3 demoted to info.
Disclude version
4.3.0
Scanned (UTC)
2026-10-23 00:24

Signals

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

  1. info warn → info by review dynamic-execution attr/_make.py:226:16

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

        """
        bytecode = compile(script, filename, "exec")
        eval(bytecode, globs, locs)
    likely benign LLM, confidence 0.95 compile() of library-generated method source in attrs' code generator.
    Reasoning

    This is the attrs library's _make_method helper, which compiles generated source for __init__/__repr__ methods. The script is built from the class's own attribute names inside the library, not from external input, so the compile call is a known code-generation pattern and not an obfuscated payload.

  2. info warn → info by review dynamic-execution attr/_make.py:227:5

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

        bytecode = compile(script, filename, "exec")
        eval(bytecode, globs, locs)
    likely benign LLM, confidence 0.95 eval() of attrs-generated bytecode to create a method.
    Reasoning

    The eval runs the bytecode produced just above by attrs' own code generator, with a controlled globals/locals namespace. It is a standard, documented way for attrs to build fast methods, and no network, process, or decoding activity appears in the snippet.

  3. info critical → info by review frame-introspection attr/_make.py:3285:28

    `sys._getframe` — call-stack frame introspection — file also calls `sys.exit`/`exec`/`eval` (anti-analysis shape) (ast pass, confidence 0.85)

        with contextlib.suppress(AttributeError, ValueError):
            type_.__module__ = sys._getframe(1).f_globals.get(
                "__name__", "__main__"
            )
    likely benign LLM, confidence 0.95 Frame introspection to set a generated class's __module__ to its caller's module name.
    Reasoning

    sys._getframe(1).f_globals.get('__name__') is the usual idiom for finding the calling module's name so a dynamically created class can get the correct __module__. The critical severity comes from the heuristic that the file also contains exec/eval, which is expected in attrs. No anti-analysis behavior is present.

Reproduce This Scan

Run disclude locally to verify. These commands scan the published file; the "new in this release" marks come from comparing it with the previous release's file, which they don't repeat. 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.3.0
curl -fsSL -o attrs-26.1.0-py3-none-any.whl https://files.pythonhosted.org/packages/64/b4/17d4b0b2a2dc85a6df63d1157e028ed19f90d4cd97c36717afef2bc2f395/attrs-26.1.0-py3-none-any.whl
printf '%s  %s\n' c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309 attrs-26.1.0-py3-none-any.whl | shasum -a 256 -c -
unzip -q attrs-26.1.0-py3-none-any.whl -d pkg
disclude scan --untrusted --severity info pkg