PyPI / zope.interface / 8.7

zope.interface 8.7

Source
https://github.com/zopefoundation/zope.interface
Tag scanned
8.7
Compared with
8.6 (0 signals introduced since)
Files
80 scanned, 8 skipped (binary, oversized, or unrecognised)
Signals
0 critical · 0 warn · 21 info
Scan time
14.7 s
LLM review
Reviewed by claude-haiku-5-5 (Anthropic): 21 of 21 warn and critical signals; 21 demoted to info.
Disclude version
4.0.0
Scanned (UTC)
2026-10-15 19:42

Signals

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

  1. info warn → info by review frame-introspection src/zope/interface/_compat.py:120:22

    `sys._getframe` — call-stack frame introspection (ast pass, confidence 0.70)

        name = name or py_impl.__name__
        globs = globs or sys._getframe(1).f_globals
    
        def find_impl():
    likely benign LLM, confidence 0.95 Uses sys._getframe to read the caller's globals in zope.interface compatibility code.
    Reasoning

    sys._getframe(1).f_globals is a standard idiom in zope.interface to find the caller's module globals for class/interface definition; no obfuscation or malicious behavior.

  2. info warn → info by review dynamic-execution src/zope/interface/common/tests/test_builtins.py:49:33

    `open(__file__)` — file reads its own source, common pattern for extracting payloads hidden in comments (ast pass, confidence 0.85)

        CONSTRUCTORS = {
            builtins.IFile: lambda: open(__file__)
        }
    likely benign LLM, confidence 0.90 Test constructor that opens the test module itself to satisfy an IFile interface check.
    Reasoning

    A test lambda opening its own source file as a stand-in for an IFile constructor; a test fixture, not payload extraction. The message's payload claim is generic and not supported by the snippet.

  3. info warn → info by review frame-introspection src/zope/interface/common/tests/test_collections.py:101:17

    `sys._getframe` — call-stack frame introspection (ast pass, confidence 0.70)

    def _get_FrameLocalsProxy():
        return type(sys._getframe().f_locals)
    likely benign LLM, confidence 0.95 Test helper fetching the frame locals proxy type via sys._getframe.
    Reasoning

    Helper retrieving the type of frame.f_locals to test FrameLocalsProxy behavior; legitimate test code for a CPython type.

  4. info warn → info by review frame-introspection src/zope/interface/common/tests/test_collections.py:133:44

    `sys._getframe` — call-stack frame introspection (ast pass, confidence 0.70)

            def FrameLocalsProxy_constructor():
                return _get_FrameLocalsProxy()(sys._getframe())
            FrameLocalsProxy = _get_FrameLocalsProxy()
            CONSTRUCTORS[FrameLocalsProxy] = FrameLocalsProxy_constructor
    likely benign LLM, confidence 0.95 Test constructor building a FrameLocalsProxy from the current frame.
    Reasoning

    Test constructor passing the current frame into the FrameLocalsProxy type to exercise the registry; benign test scaffolding.

  5. info warn → info by review frame-introspection src/zope/interface/declarations.py:1039:13

    `sys._getframe` — call-stack frame introspection (ast pass, confidence 0.70)

        """
        frame = sys._getframe(1)  # pylint:disable=protected-access
        locals = frame.f_locals   # pylint:disable=redefined-builtin
    likely benign LLM, confidence 0.95 Reads caller frame locals to implement class-level declaration helpers.
    Reasoning

    Caller-frame locals access is the documented mechanism used by implementer-style declarations in zope.interface; standard library introspection for a framework.

  6. info warn → info by review frame-introspection src/zope/interface/interface.py:51:16

    `sys._getframe` — call-stack frame introspection (ast pass, confidence 0.70)

    def invariant(call):
        f_locals = sys._getframe(1).f_locals
        tags = f_locals.setdefault(TAGGED_DATA, {})
        invariants = tags.setdefault('invariants', [])
    likely benign LLM, confidence 0.95 Reads the caller's class-body locals to register interface invariants.
    Reasoning

    The invariant decorator-style helper reads the calling class body's locals to attach tagged data, a known zope.interface design; no malicious intent.

  7. info warn → info by review frame-introspection src/zope/interface/interface.py:60:16

    `sys._getframe` — call-stack frame introspection (ast pass, confidence 0.70)

        """Attaches a tagged value to an interface at definition time."""
        f_locals = sys._getframe(1).f_locals
        tagged_values = f_locals.setdefault(TAGGED_DATA, {})
        tagged_values[key] = value
    likely benign LLM, confidence 0.95 Attaches tagged values to an interface by writing into the caller's class-body locals.
    Reasoning

    Same caller-locals pattern used to attach tagged values at interface definition time; legitimate framework code.

  8. info warn → info by review frame-introspection src/zope/interface/interface.py:641:22

    `sys._getframe` — call-stack frame introspection (ast pass, confidence 0.70)

            # could be raised.
            __module__ = sys._getframe(1).f_globals['__name__']
            # Get the C optimized __module__ accessor and give it
            # to the new class.
    likely benign LLM, confidence 0.95 Sets __module__ on a new interface class from the caller's global name.
    Reasoning

    Reads the caller's __name__ to set __module__ for a new class, a standard way to fix module attribution; benign.

  9. info warn → info by review frame-introspection src/zope/interface/interface.py:686:16

    `sys._getframe` — call-stack frame introspection (ast pass, confidence 0.70)

        """
        f_locals = sys._getframe(1).f_locals
        methods = f_locals.setdefault(INTERFACE_METHODS, {})
        methods[func.__name__] = func
    likely benign LLM, confidence 0.95 Registers interface methods by writing into the caller's class-body locals.
    Reasoning

    Caller-locals access to register interface methods during class body execution; standard zope.interface mechanism.

  10. info warn → info by review frame-introspection src/zope/interface/interface.py:767:34

    `sys._getframe` — call-stack frame introspection (ast pass, confidence 0.70)

                        # a class, but of course it does it in C. :-/
                        __module__ = sys._getframe(1).f_globals['__name__']
                    except (AttributeError, KeyError):  # pragma: no cover
                        pass
    likely benign LLM, confidence 0.95 Sets __module__ from the caller's globals with a defensive fallback.
    Reasoning

    Retrieves caller's __name__ inside a try/except as a fallback for __module__ assignment; benign.

  11. info warn → info by review frame-introspection src/zope/interface/tests/advisory_testing.py:26:40

    `sys._getframe` — call-stack frame introspection (ast pass, confidence 0.70)

        __metaclass__ = type
        classLevelFrameInfo = getFrameInfo(sys._getframe())
    likely benign LLM, confidence 0.93 Test fixture capturing class-level frame info for advice tests.
    Reasoning

    Test fixture capturing frame info at class level to verify advice behavior; benign test code.

  12. info warn → info by review frame-introspection src/zope/interface/tests/advisory_testing.py:29:37

    `sys._getframe` — call-stack frame introspection (ast pass, confidence 0.70)

    
    moduleLevelFrameInfo = getFrameInfo(sys._getframe())
    likely benign LLM, confidence 0.93 Test fixture capturing module-level frame info for advice tests.
    Reasoning

    Module-level frame info capture in a test fixture for advice testing; benign.

  13. info critical → info by review frame-introspection src/zope/interface/tests/test_advice.py:55:58

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

            from zope.interface.advice import getFrameInfo
            kind, module, f_locals, f_globals = getFrameInfo(sys._getframe())
            self.assertEqual(kind, "function call")
    likely benign LLM, confidence 0.85 Test asserting frame info for a function call via sys._getframe.
    Reasoning

    The critical severity comes only from the file also containing exec/eval, which here is used to test advice frame kinds. The snippet is a plain frame-info assertion in a test; the anti-analysis shape is a context artifact, not evidence of evasion.

  14. info critical → info by review frame-introspection src/zope/interface/tests/test_advice.py:58:17

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

    
            frame = sys._getframe()
            self.assertEqual(f_locals, frame.f_locals)
            self.assertEqual(f_locals, locals())
    likely benign LLM, confidence 0.85 Test comparing sys._getframe locals with locals() for correctness.
    Reasoning

    Test comparing frame locals to locals() to verify frame introspection; the critical flag reflects co-location with exec in the test file, not malicious behavior.

  15. info warn → info by review dynamic-execution src/zope/interface/tests/test_advice.py:69:9

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

            _locals = {}
            exec(_FUNKY_EXEC, _globals, _locals)
            self.assertEqual(_locals['kind'], "exec")
            self.assertIs(_locals['f_locals'], _locals)
    likely benign LLM, confidence 0.85 Test executing a fixed code string via exec to check advice frame kind.
    Reasoning

    exec on a module constant _FUNKY_EXEC with explicit globals and locals dicts, used to test advice behavior under exec; a deliberate test of exec frame kind, not hidden payload execution.

  16. info warn → info by review decoder-import-with-exec src/zope/interface/tests/test_declarations.py:59:17

    file imports decoder module(s) pickle and calls `exec`/`eval`/`compile` — multi-stage payload shape (ast pass, confidence 0.80)

                try:
                    exec(code, globs, locs)
                except TypeError:
                    return False
    likely benign LLM, confidence 0.85 A test helper that execs a code string to check class-advice behaviour.
    Reasoning

    The snippet is a try/except around exec(code, globs, locs) that returns False on TypeError, which matches zope.interface's class-advice check for module-scope definitions. The pickle import is a common test-suite pattern and does not show a decode-then-run chain. The exec target is a test fixture string, not attacker-controlled input.

  17. info warn → info by review dynamic-execution src/zope/interface/tests/test_declarations.py:59:17

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

                try:
                    exec(code, globs, locs)
                except TypeError:
                    return False
    likely benign LLM, confidence 0.85 Same test helper flagged again for exec on a non-literal expression.
    Reasoning

    The same exec(code, globs, locs) call is flagged as a non-literal exec. In this test module the code comes from test fixtures, and the call sits inside a helper that checks whether a class-advice body is legal. Nothing in the snippet shows untrusted input reaching exec.

  18. info warn → info by review dynamic-execution src/zope/interface/tests/test_declarations.py:2051:9

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

            ])
            exec(CODE, globs, locs)
            foo = locs['foo']
            self.assertRaises(TypeError, foo)
    likely benign LLM, confidence 0.90 Test executes a constant code string to verify advice raises TypeError.
    Reasoning

    exec(CODE, globs, locs) runs a module-level CODE constant defined in the test, then checks that calling foo raises TypeError. This is a deliberate test of advice behaviour, not an injected payload.

  19. info warn → info by review dynamic-execution src/zope/interface/tests/test_declarations.py:2066:13

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

            with self.assertRaises(TypeError):
                exec(CODE, globs, locs)
    
        def test_called_once_from_module_scope(self):
    likely benign LLM, confidence 0.90 Negative test that execs a fixed CODE string inside assertRaises.
    Reasoning

    Inside assertRaises(TypeError), exec(CODE, globs, locs) runs a fixed test string. The test expects the exec to fail, which is a regression check on the advice machinery.

  20. info warn → info by review dynamic-execution src/zope/interface/tests/test_declarations.py:2076:9

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

            ])
            exec(CODE, globs)
            spec = globs['__provides__']
            self.assertEqual(list(spec), [IFoo])
    likely benign LLM, confidence 0.90 Test execs a constant snippet to inspect a module-level __provides__ spec.
    Reasoning

    exec(CODE, globs) runs a fixed test CODE string, and the test then reads __provides__ from globs to check the declared interfaces. This is standard test scaffolding for module-scope provides declarations.

  21. info warn → info by review dynamic-execution src/zope/interface/tests/test_declarations.py:2091:13

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

            with self.assertRaises(TypeError):
                exec(CODE, globs)
    likely benign LLM, confidence 0.90 Negative test that execs a fixed CODE string expecting a TypeError.
    Reasoning

    Inside assertRaises(TypeError), exec(CODE, globs) runs a fixed test string. The expected failure confirms the implementation rejects that construct.

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.0.0
git clone https://github.com/zopefoundation/zope.interface zope.interface && cd zope.interface
git checkout 8.7
disclude scan --severity info --diff 8.6 .