PyPI / pypdf / 6.21.1

pypdf 6.21.1

Source
https://github.com/py-pdf/pypdf
Tag scanned
6.21.1
Compared with
6.21.0 (0 signals introduced since)
Files
187 scanned, 110 skipped (binary, oversized, or unrecognised)
Signals
0 critical · 0 warn · 40 info
Scan time
21.2 s
LLM review
Reviewed by claude-haiku-5-5 (Anthropic): 28 of 29 warn and critical signals; 29 demoted to info.
Disclude version
4.1.0
Scanned (UTC)
2026-10-22 06:57

Signals

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

  1. info warn → info by review encoding-base64 docs/meta/faq.md:21:288

    base64-like blob (66 bytes, compression ratio 1.17) (raw pass, confidence 0.60)

    ://github.com/Giacomo-De-Florio-Dev/Make_Your_PDF_Safe/tree/ec439f92243d12d54ae024668792470c6b40ee96/MakeYourPDFsafe_V1.3/PyPDF2). That
    likely benign LLM, confidence 0.90 A GitHub URL containing a commit hash in a documentation FAQ.
    Reasoning

    The base64-like match is a fragment of a GitHub URL path in a markdown FAQ; the hash-like string is a commit reference, not a payload.

  2. info warn → info by review payload-bytes-literal pypdf/_encryption.py:114:5

    concatenated bytes literal contains 32 `\xNN` escapes (100% of content) — binary payload shape (ast pass, confidence 0.85)

    _PADDING = (
        b"\x28\xbf\x4e\x5e\x4e\x75\x8a\x41\x64\x00\x4e\x56\xff\xfa\x01\x08"
        b"\x2e\x2e\x00\xb6\xd0\x68\x3e\x80\x2f\x0c\xa9\xfe\x64\x53\x69\x7a"
    )
    likely benign LLM, confidence 0.93 Standard PDF encryption padding bytes constant in pypdf's encryption module.
    Reasoning

    _PADDING is the standard 32-byte RC4/AESV2 password padding constant from the PDF specification (starts 0x28 0xBF 0x4E 0x5E...), a well-known fixed value used in PDF encryption, not a hidden payload.

  3. info warn → info by review encoding-hex pypdf/_encryption.py:114:7

    16 consecutive `\xNN` escapes (entropy 3.7 bits/byte) (raw pass, confidence 0.65)

    _PADDING = (
        b"\x28\xbf\x4e\x5e\x4e\x75\x8a\x41\x64\x00\x4e\x56\xff\xfa\x01\x08"
        b"\x2e\x2e\x00\xb6\xd0\x68\x3e\x80\x2f\x0c\xa9\xfe\x64\x53\x69\x7a"
    )
    likely benign LLM, confidence 0.92 Hex-escaped PDF padding constant in encryption code.
    Reasoning

    Same PDF specification padding constant; hex escapes are a normal way to express fixed binary constants.

  4. info warn → info by review encoding-hex pypdf/_encryption.py:115:7

    16 consecutive `\xNN` escapes (entropy 3.9 bits/byte) (raw pass, confidence 0.65)

        b"\x28\xbf\x4e\x5e\x4e\x75\x8a\x41\x64\x00\x4e\x56\xff\xfa\x01\x08"
        b"\x2e\x2e\x00\xb6\xd0\x68\x3e\x80\x2f\x0c\xa9\xfe\x64\x53\x69\x7a"
    )
    likely benign LLM, confidence 0.92 Second line of the PDF encryption padding constant.
    Reasoning

    Continuation of the same standard PDF padding constant.

  5. info warn → info by review dynamic-attribute pypdf/_page.py:2279:20

    reach-by-name through `locals` (ast pass, confidence 0.60)

                ):
                    if locals()[visitor]:
                        logger_warning(
                            "Argument %(visitor)s is ignored in layout mode",
    likely benign LLM, confidence 0.90 Checks a local visitor parameter by name via locals() in page extraction code.
    Reasoning

    locals() lookup of a visitor argument name is a common idiom in pypdf for checking whether optional visitor functions were passed; it operates on local parameters, not attacker-controlled names.

  6. info warn → info by review decoder-decompress-payload pypdf/filters.py:95:20

    file imports decoder module(s) binascii, zlib, base64 and calls `.decompress()` — embedded payload decompressed at runtime (ast pass, confidence 0.75)

    def _decompress_with_limit(data: bytes) -> bytes:
        decompressor = zlib.decompressobj()
        configuration = get_configuration()
        result = decompressor.decompress(data, max_length=configuration.zlib_maximum_output_length)
    likely benign LLM, confidence 0.85 Size-limited zlib decompression for PDF Flate streams.
    Reasoning

    zlib decompressobj with max_length is the standard, size-limited FlateDecode decompression used to parse PDF streams; this is a legitimate PDF library function, not a hidden runtime payload.

  7. info warn → info by review payload-bytes-literal pypdf/generic/_image_inline.py:195:13

    concatenated bytes literal contains 38 `\xNN` escapes (100% of content) — binary payload shape (ast pass, confidence 0.85)

            elif c in (
                b"\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc9\xca\xcb\xcc\xcd\xce\xcf"
                b"\xda\xdb\xdc\xdd\xde\xdf"
                b"\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xfe"
    likely benign LLM, confidence 0.90 Byte-value constants used when parsing inline image data in pypdf.
    Reasoning

    A tuple of byte constants representing PDF inline image filter/byte values used in parsing; a lookup table of fixed bytes, not a dropper.

  8. info warn → info by review encoding-hex pypdf/generic/_image_inline.py:197:15

    17 consecutive `\xNN` escapes (entropy 4.1 bits/byte) (raw pass, confidence 0.65)

                b"\xda\xdb\xdc\xdd\xde\xdf"
                b"\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xfe"
            ):
                c = read(2)
    likely benign LLM, confidence 0.90 Continuation of inline image byte constant table.
    Reasoning

    Continuation of the same byte constant table used in inline image parsing; hex escapes are ordinary for binary values.

  9. info warn → info by review unicode-mixed-script resources/crazyones.txt:3:30

    identifier `misfits` mixes scripts: Latin + Other (raw pass, confidence 0.80)

    October 14, 1998
    Heres to the crazy ones. The misfits. The rebels. The troublemakers.
    The round pegs in the square holes.
    The ones who see things differently. Theyre not fond of rules. And
    likely benign LLM, confidence 0.88 Typographic ligature in a text resource file quoting a famous speech.
    Reasoning

    The 'fi' in 'misfits' is a typographic ligature (U+FB01) from the original quotation text, a common artifact of copied PDF/web text; it is not an identifier spoofing attempt in a code context.

  10. info warn → info by review unicode-mixed-script resources/crazyones.txt:5:25

    identifier `differently` mixes scripts: Latin + Other (raw pass, confidence 0.80)

    The round pegs in the square holes.
    The ones who see things differently. Theyre not fond of rules. And
    they have no respect for the status quo. You can quote them,
    disagree with them, glorify or vilify them.
    likely benign LLM, confidence 0.88 Typographic ligature in a text fixture quoting a famous speech.
    Reasoning

    'ff' ligature in 'differently' is a typographic ligature from copied text, not malicious spoofing in a text fixture.

  11. info warn → info by review unicode-mixed-script resources/crazyones_layout_vertical_space.txt:4:34

    identifier `misfits` mixes scripts: Latin + Other (raw pass, confidence 0.80)

    
       Heres to the crazy ones.  The misfits.  The rebels.  The troublemakers.
           The round pegs in the square holes.
       The ones who see things differently.  Theyre not fond of rules.  And
    likely benign LLM, confidence 0.88 Ligature in a layout test text resource.
    Reasoning

    Same typographic ligature in a test resource text file; benign text artifact.

  12. info warn → info by review unicode-mixed-script resources/crazyones_layout_vertical_space.txt:6:28

    identifier `differently` mixes scripts: Latin + Other (raw pass, confidence 0.80)

           The round pegs in the square holes.
       The ones who see things differently.  Theyre not fond of rules.  And
           they have no respect for the status quo.  You can quote them,
           disagree with them, glorify or vilify them.
    likely benign LLM, confidence 0.88 Ligature in a layout test text resource.
    Reasoning

    Same typographic ligature in a test resource; benign text artifact.

  13. info warn → info by review unicode-mixed-script resources/crazyones_layout_vertical_space_font_height_weight.txt:4:34

    identifier `misfits` mixes scripts: Latin + Other (raw pass, confidence 0.80)

    
       Heres to the crazy ones.  The misfits.  The rebels.  The troublemakers.
           The round pegs in the square holes.
    likely benign LLM, confidence 0.88 Ligature in a font layout test text resource.
    Reasoning

    Same typographic ligature in a test resource text file; benign text artifact.

  14. info warn → info by review unicode-mixed-script resources/crazyones_layout_vertical_space_font_height_weight.txt:7:28

    identifier `differently` mixes scripts: Latin + Other (raw pass, confidence 0.80)

    
       The ones who see things differently.  Theyre not fond of rules.  And
           they have no respect for the status quo.  You can quote them,
           disagree with them, glorify or vilify them.
    likely benign LLM, confidence 0.88 Ligature in a font layout test text resource.
    Reasoning

    Same typographic ligature in a test resource; benign text artifact.

  15. info warn → info by review long-line resources/jpeg.txt:1:1

    line length 82804 characters (raw pass, confidence 0.65)

    ffd8ffe000104a46494600010100000100010000ffdb0043000302020302020303030304030304050805050404050a070706080c0a0c0c0b0a0b0b0d0e12100d0e110e0b0b1016101113141515150c0f171816141812141514ffdb00430103040405040509050509140d0b0d1414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414ffc2
    likely benign LLM, confidence 0.85 A single very long line of hex-encoded JPEG data in a text resource file.
    Reasoning

    The line is a hex dump of JPEG header and quantization table bytes stored in a text resource. The long line is a data fixture, not code that executes or hides anything.

  16. info warn → info by review unicode-mixed-script resources/multicolumn-lorem-ipsum.txt:8:52

    identifier `filled` mixes scripts: Other + Latin (raw pass, confidence 0.80)

    This  is  a  sample  document  with  two  columns  filled              molestie vitae, placerat a, molestie nec, leo.  Maece-
    with Lorem Ipsum text.                                                nas lacinia.  Nam ipsum ligula, eleifend at, accumsan
    likely benign LLM, confidence 0.90 A typographic fi ligature inside a lorem ipsum sample text file.
    Reasoning

    The 'fi' ligature is a typical artifact of text extracted from a PDF, and the file is Lorem Ipsum sample text. It is a raw-pass finding with a high false-positive rate and no code behind it.

  17. info warn → info by review frame-introspection tests/generic/test_font.py:290:34

    `inspect.currentframe` — call-stack frame introspection (ast pass, confidence 0.70)

        def build_reversed_min(_self: table__c_m_a_p) -> Any:
            caller = cast(FrameType, inspect.currentframe()).f_back
            caller_name = cast(FrameType, caller).f_code.co_name
            # Check the backwards-compatible substitution works when calling from pypdf
    likely benign LLM, confidence 0.90 A test helper that reads its caller's frame name to verify compatibility behaviour.
    Reasoning

    The test uses inspect.currentframe().f_back to check the caller's name so a backwards-compatible substitution behaves correctly when called from pypdf. This is ordinary test scaffolding.

  18. info unicode-homoglyph tests/test_cmap.py:196:18

    identifier `α` contains homoglyph candidates: α (03B1)→a (in string/comment) (raw pass, confidence 0.35)

        txt = reader.pages[0].extract_text()  # no error
        for pat in ("α", "β", "γ", "ϕ", "φ", "ℏ", "∫", "∂", "·", "×"):
            assert pat in txt
        # actually the ϕ and φ seems to be crossed in latex
  19. info warn → info by review payload-bytes-literal tests/test_filters.py:253:9

    concatenated bytes literal contains 104 `\xNN` escapes (99% of content) — binary payload shape (ast pass, confidence 0.85)

        assert CCITTFaxDecode.decode(data, parameters) == (
            b"II*\x00\x08\x00\x00\x00\x08\x00\x00\x01\x04\x00\x01\x00\x00\x00\x11\x00"
            b"\x00\x00\x01\x01\x04\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02\x01"
            b"\x03\x00\x01\x00\x00\x00\x01\x00\x00\x00\x03\x01\x03\x00\x01\x00"
    likely benign LLM, confidence 0.92 Binary CCITT fax test fixture data used in a filter decode assertion.
    Reasoning

    A concatenated bytes literal of TIFF-like CCITT image data is passed to a decoder and compared with expected output. Binary fixtures are normal in codec tests.

  20. info warn → info by review payload-bytes-literal tests/test_filters.py:788:9

    concatenated bytes literal contains 67 `\xNN` escapes (99% of content) — binary payload shape (ast pass, confidence 0.85)

        image_data = (
            b'\x00\x00\x00\x010\x00\x01\x00\x00\x00\x13\x00\x00\x00\x05\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x06"'
            b'\x00\x01\x00\x00\x00\x1c\x00\x00\x00\x05\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x9f\xa8_\xff\xac'
    likely benign LLM, confidence 0.92 Duplicate report of the binary image data fixture at line 788.
    Reasoning

    This is a repeat of the same binary image fixture as the 788 finding, reported by a second rule. The content is test data.

  21. info warn → info by review payload-bytes-literal tests/test_filters.py:788:9

    bytes literal contains 34 `\xNN` escapes (99% of content) — binary payload shape (ast pass, confidence 0.85)

        image_data = (
            b'\x00\x00\x00\x010\x00\x01\x00\x00\x00\x13\x00\x00\x00\x05\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x06"'
            b'\x00\x01\x00\x00\x00\x1c\x00\x00\x00\x05\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x9f\xa8_\xff\xac'
    likely benign LLM, confidence 0.92 Duplicate report of the binary image data fixture at line 788.
    Reasoning

    This is a repeat of the same binary image fixture as the 788 finding, reported by a second rule. The content is test data.

  22. info warn → info by review payload-bytes-literal tests/test_filters.py:789:9

    bytes literal contains 33 `\xNN` escapes (99% of content) — binary payload shape (ast pass, confidence 0.85)

            b'\x00\x00\x00\x010\x00\x01\x00\x00\x00\x13\x00\x00\x00\x05\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x06"'
            b'\x00\x01\x00\x00\x00\x1c\x00\x00\x00\x05\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x9f\xa8_\xff\xac'
    
        )
    likely benign LLM, confidence 0.92 Continuation of the binary image data fixture in a filter test.
    Reasoning

    This is a continuation of the binary image fixture from the same test. It is data for codec testing with no execution path.

  23. info warn → info by review payload-bytes-literal tests/test_filters.py:792:21

    bytes literal contains 32 `\xNN` escapes (98% of content) — binary payload shape (ast pass, confidence 0.85)

        )
        jbig2_globals = b"\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x18\x00\x00\x03\xff\xfd\xff\x02\xfe\xfe\xfe\x00\x00\x00\x01\x00\x00\x00\x01R\xd0u7\xff\xac"  # noqa: E501
    
        # Validation: Is our image data valid?
    likely benign LLM, confidence 0.92 JBIG2 globals binary fixture used in a decoder test.
    Reasoning

    The JBIG2 globals bytes are a known test vector used when decoding JBIG2 images. The noqa comment shows the long line was accepted on purpose.

  24. info warn → info by review payload-bytes-literal tests/test_filters.py:1086:9

    concatenated bytes literal contains 780 `\xNN` escapes (88% of content) — binary payload shape (ast pass, confidence 0.85)

        image_data = (
            b"\nBI\n  /W 16\n  /H 16\n  /CS /G\n  /BPC 8\n  /F [/DCT]\nID\n"
            b"\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x01,\x01,\x00\x00\xff\xfe\x00\x13Created with GIMP\xff\xe2"
    likely benign LLM, confidence 0.92 Inline PDF image stream containing JPEG bytes as a test fixture.
    Reasoning

    This is an inline image stream with PDF operators and a JFIF-encoded JPEG payload, the kind of data a PDF image test would contain. It has no executable or hidden content.

  25. info warn → info by review payload-bytes-literal tests/test_filters.py:1288:5

    concatenated bytes literal contains 310 `\xNN` escapes (100% of content) — binary payload shape (ast pass, confidence 0.85)

    _FLATE_IMAGE_DATA = (
        b"\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00"
    likely benign LLM, confidence 0.92 Raw pixel byte constant used as flate image test data.
    Reasoning

    The data is a flate-compressed raw image pixel buffer in a test constant. Its shape matches raw pixel data, not a payload.

  26. info warn → info by review frame-introspection tests/test_generic.py:1287:5

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

        previous_trace = sys.gettrace()
        sys.settrace(trace)
        try:
            clone = container.clone(writer)
    likely benign LLM, confidence 0.85 Test code that temporarily installs a trace function around a clone call.
    Reasoning

    The code saves the previous trace function, installs a tracer around a clone operation, and restores it in a finally block. This pattern is used in tests to check that clone does not leak or disturb trace state, and it is not malicious.

  27. info warn → info by review frame-introspection tests/test_generic.py:1291:9

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

        finally:
            sys.settrace(previous_trace)
            if gc_was_enabled:
                gc.enable()
    likely benign LLM, confidence 0.85 Cleanup that restores the prior trace function and gc state after a test.
    Reasoning

    This restores the previous trace function in a finally block and re-enables gc if needed. It is cleanup for the same test, so it is ordinary test hygiene.

  28. info warn → info by review payload-bytes-literal tests/test_images.py:723:13

    concatenated bytes literal contains 43 `\xNN` escapes (84% of content) — binary payload shape (ast pass, confidence 0.85)

            assert images["~0~"].data == (
                b"\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x02\x00\x00\x00\x01\x08\x02\x00\x00\x00{@\xe8\xdd\x00\x00\x00\x0f"
                b"IDATx\x9cc\xe8\xee\xee\xfe\xf7\xef\x1f\x00\x0e \x04\x9cpr_\x96\x00\x00\x00\x00IEND\xaeB`\x82"
            )
    likely benign LLM, confidence 0.95 A test fixture embedding a small PNG image as a bytes literal for comparison.
    Reasoning

    The bytes literal is a PNG file header plus IDAT and IEND chunks, used as expected data in a test assertion comparing against a decoded image. Binary test fixtures are normal in image library tests; the escapes reflect raw PNG bytes, not hidden execution.

  29. info unicode-mixed-script tests/test_text_extraction.py:1238:23

    identifier `ابحرمAB` mixes scripts: Arabic + Latin (in string/comment) (raw pass, confidence 0.40)

            pytest.param("AB ابحرم", "AB مرحبا", id="latin-before"),
            pytest.param("ابحرمAB", "مرحباAB", id="latin-after"),
        ],
    )
  30. info unicode-mixed-script tests/test_text_extraction.py:1238:39

    identifier `مرحباAB` mixes scripts: Arabic + Latin (in string/comment) (raw pass, confidence 0.40)

            pytest.param("AB ابحرم", "AB مرحبا", id="latin-before"),
            pytest.param("ابحرمAB", "مرحباAB", id="latin-after"),
        ],
    )
  31. info unicode-mixed-script tests/test_xmp.py:1065:11

    identifier `fooↂzz` mixes scripts: Latin + Other (in string/comment) (raw pass, confidence 0.40)

            # Non-hex digits, a marker at the end and a truncated escape are all kept as-is.
            ("fooↂzz", {"fooↂzz": "val"}),
            ("fooↂ", {"fooↂ": "val"}),
            ("fooↂ0", {"fooↂ0": "val"}),
  32. info unicode-mixed-script tests/test_xmp.py:1065:24

    identifier `fooↂzz` mixes scripts: Latin + Other (in string/comment) (raw pass, confidence 0.40)

            # Non-hex digits, a marker at the end and a truncated escape are all kept as-is.
            ("fooↂzz", {"fooↂzz": "val"}),
            ("fooↂ", {"fooↂ": "val"}),
            ("fooↂ0", {"fooↂ0": "val"}),
  33. info unicode-mixed-script tests/test_xmp.py:1066:11

    identifier `fooↂ` mixes scripts: Latin + Other (in string/comment) (raw pass, confidence 0.40)

            ("fooↂzz", {"fooↂzz": "val"}),
            ("fooↂ", {"fooↂ": "val"}),
            ("fooↂ0", {"fooↂ0": "val"}),
            # A well-formed escape is still decoded (Adobe stores "my car" this way).
  34. info unicode-mixed-script tests/test_xmp.py:1066:22

    identifier `fooↂ` mixes scripts: Latin + Other (in string/comment) (raw pass, confidence 0.40)

            ("fooↂzz", {"fooↂzz": "val"}),
            ("fooↂ", {"fooↂ": "val"}),
            ("fooↂ0", {"fooↂ0": "val"}),
            # A well-formed escape is still decoded (Adobe stores "my car" this way).
  35. info unicode-mixed-script tests/test_xmp.py:1067:11

    identifier `fooↂ0` mixes scripts: Latin + Other (in string/comment) (raw pass, confidence 0.40)

            ("fooↂ", {"fooↂ": "val"}),
            ("fooↂ0", {"fooↂ0": "val"}),
            # A well-formed escape is still decoded (Adobe stores "my car" this way).
            ("myↂ0020car", {"my car": "val"}),
  36. info unicode-mixed-script tests/test_xmp.py:1067:23

    identifier `fooↂ0` mixes scripts: Latin + Other (in string/comment) (raw pass, confidence 0.40)

            ("fooↂ", {"fooↂ": "val"}),
            ("fooↂ0", {"fooↂ0": "val"}),
            # A well-formed escape is still decoded (Adobe stores "my car" this way).
            ("myↂ0020car", {"my car": "val"}),
  37. info unicode-mixed-script tests/test_xmp.py:1069:11

    identifier `myↂ0020car` mixes scripts: Latin + Other (in string/comment) (raw pass, confidence 0.40)

            # A well-formed escape is still decoded (Adobe stores "my car" this way).
            ("myↂ0020car", {"my car": "val"}),
        ],
    )
  38. identifier `AאA` mixes scripts: Latin + Hebrew (in string/comment) (raw pass, confidence 0.40)

            font=font,
            text_operands="AאA",
            font_size=12,
            rtl_dir=False,
  39. info warn → info by review frame-introspection tests/utils.py:255:5

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

        previous_profile = sys.getprofile()
        sys.setprofile(count_calls)
        try:
            result = func(*args, **kwargs)
    likely benign LLM, confidence 0.93 A test utility that temporarily installs a call-counting profiler around a function call.
    Reasoning

    Saving the previous profiler, installing a call-counting profile function around a call, and restoring it is a standard test helper for counting function calls. It is not malicious and does not exfiltrate or execute anything.

  40. info warn → info by review frame-introspection tests/utils.py:259:9

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

        finally:
            sys.setprofile(previous_profile)
        return result, calls
    likely benign LLM, confidence 0.93 Restores the previous profile function after a test call-counting helper runs.
    Reasoning

    This is the restore step in the finally block of the same profiling helper, resetting the previous profile function. Consistent with benign test instrumentation.

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/py-pdf/pypdf pypdf && cd pypdf
git checkout 6.21.1
disclude scan --severity info --diff 6.21.0 .