PyPI / pyyaml / 6.0.3

pyyaml 6.0.3

Source
https://github.com/yaml/pyyaml
Artifact scanned
pyyaml-6.0.3.tar.gz (sdist · 127.9 KB · SHA-256 d76623373421…)
Compared with
pyyaml-6.0.2.tar.gz (0 signals introduced since)
Files
54 scanned, 586 skipped (binary, oversized, or unrecognised)
Signals
0 critical · 0 warn · 10 info
Scan time
9.1 s
LLM review
Reviewed by claude-haiku-5-5 (Anthropic): 10 of 10 warn and critical signals; 10 demoted to info.
Disclude version
4.3.0
Scanned (UTC)
2026-10-22 23:36

Signals

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

  1. info warn → info by review decoder-decompress-payload lib/yaml/constructor.py:303:24

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

                if hasattr(base64, 'decodebytes'):
                    return base64.decodebytes(value)
                else:
                    return base64.decodestring(value)
    likely benign LLM, confidence 0.93 Base64 decoding of !!binary YAML scalars in the PyYAML constructor.
    Reasoning

    This is PyYAML's !!binary handler, which decodes base64 data that the YAML document explicitly tags as binary. The decodestring fallback is a Python 2/3 compatibility branch. Decoding is the documented purpose of the function, not hidden execution.

  2. info critical → info by review dynamic-import lib/yaml/constructor.py:531:17

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

                try:
                    __import__(name)
                except ImportError as exc:
                    raise ConstructorError("while constructing a Python module", mark,
    likely benign LLM, confidence 0.82 Dynamic __import__ of a module name for the !!python/module YAML tag.
    Reasoning

    This is the python/module tag handler in PyYAML's unsafe constructor. It imports a module named in the document so the tag can resolve it, and it raises ConstructorError on ImportError. This is a known, intentional feature of the unsafe loader rather than obfuscation. It is still a real risk if fed untrusted YAML, so it is not fully dismissed.

  3. info critical → info by review dynamic-import lib/yaml/constructor.py:551:17

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

                try:
                    __import__(module_name)
                except ImportError as exc:
                    raise ConstructorError("while constructing a Python object", mark,
    likely benign LLM, confidence 0.82 Dynamic __import__ used to resolve the !!python/object YAML tag.
    Reasoning

    This is the python/object tag resolution path in PyYAML's unsafe constructor, which imports the named module before looking up the object. It is intentional library behaviour for an explicitly unsafe tag, with the same caveat that untrusted input makes it dangerous.

  4. info warn → info by review dynamic-execution tests/legacy_tests/test_constructor.py:13:5

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

        global value
        exec(code)
        return value
    likely benign LLM, confidence 0.90 Test helper that exec()s fixture code to build expected values.
    Reasoning

    This is a test helper that execs Python source text from a test fixture to check YAML python tag round-trips. It is test scaffolding over controlled test data, not a payload.

  5. info warn → info by review dynamic-execution tests/legacy_tests/test_constructor.py:235:12

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

    def _load_code(expression):
        return eval(expression)
    
    def _serialize_value(data):
    likely benign LLM, confidence 0.90 Test helper that eval()s a Python expression for comparison.
    Reasoning

    This helper evals an expression string in a test module to compare against YAML-constructed values. The input comes from the test suite itself, so it is a harness pattern.

  6. info warn → info by review dynamic-execution tests/legacy_tests/test_errors.py:59:9

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

            from io import StringIO
            exec(code)
        except yaml.YAMLError as exc:
            if verbose:
    likely benign LLM, confidence 0.90 Test exec() of fixture code to trigger and check YAML errors.
    Reasoning

    The exec runs a code fixture inside a test that expects a YAMLError. It exercises error reporting in the test suite, and the code comes from the repository's own test data.

  7. info warn → info by review dynamic-execution tests/legacy_tests/test_multi_constructor.py:6:12

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

    def _load_code(expression):
        return eval(expression)
    
    def myconstructor1(constructor, tag, node):
    likely benign LLM, confidence 0.90 Test helper that eval()s expressions for multi-constructor tests.
    Reasoning

    This is the same eval-based expression helper used in PyYAML's multi-constructor tests. It evaluates test-supplied expressions and is test-only code.

  8. info warn → info by review dynamic-execution tests/legacy_tests/test_recursive.py:28:9

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

        with open(recursive_filename, 'rb') as file:
            exec(file.read(), context)
        value1 = context['value']
        output1 = None
    likely benign LLM, confidence 0.90 Test exec() of a recursive fixture file to build expected objects.
    Reasoning

    The exec reads a recursive-structure fixture file from the test directory and runs it in a context dict to compare against YAML loading. This is standard test-harness behaviour on repository data.

  9. info warn → info by review dynamic-execution tests/legacy_tests/test_structure.py:38:18

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

        with open(structure_filename, 'r') as file:
            nodes2 = eval(file.read())
        try:
            with open(data_filename, 'rb') as file:
    likely benign LLM, confidence 0.90 Test eval() of a structure fixture file to build expected nodes.
    Reasoning

    The eval reads a structure fixture file from the test data directory to produce expected nodes. It is test-only code operating on bundled fixtures.

  10. info warn → info by review dynamic-attribute tests/legacy_tests/test_yaml_ext.py:284:9

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

            assert function.__name__ not in globals()
            globals()[function.__name__] = function
    
    import test_tokens, test_structure, test_errors, test_resolver, test_constructor,   \
    likely benign LLM, confidence 0.85 Test runner registers test functions into module globals by name.
    Reasoning

    The code checks whether a test function name is already in globals and then registers it, which is how this test runner collects test functions. It is a common test-discovery idiom, not hidden access.

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 pyyaml-6.0.3.tar.gz https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz
printf '%s  %s\n' d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f pyyaml-6.0.3.tar.gz | shasum -a 256 -c -
mkdir pkg && tar -xzf pyyaml-6.0.3.tar.gz -C pkg --strip-components 1
disclude scan --untrusted --severity info pkg