MAL-2026-18772

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/pypi/parseyaml/MAL-2026-18772.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-18772
Published
2026-11-08T21:45:25Z
Modified
2026-11-12T03:45:03Z
Summary
Malicious code in parseyaml (PyPI)
Details

-= Per source details. Do not edit below this line.=-

Source: amazon-inspector (42b56cbea8e7b46f2ad7dc1d59334a45862f50366944ee198e97c68a313681ef)

parseyaml 1.2.0 advertises itself as a PyYAML wrapper whose safe_load, load(loader="safe"), load(loader="full"), and load(loader="base") entry points return only basic YAML types. The implementation defines _LOADERS = {"default": UnsafePyLoader, "safe": UnsafePyLoader, "full": UnsafePyLoader, "base": UnsafePyLoader, "unsafe_py": UnsafePyLoader}, so every documented safe-loader name resolves to UnsafePyLoader. UnsafePyLoader registers a !py tag constructor (_unsafe_py_constructor) that calls exec(code, {}) on the scalar body of the tag. Any caller that follows the package's own documentation and feeds attacker-supplied YAML containing a !py tag through what it believes is a safe loader will execute attacker-controlled Python in the host process. The exec sink is hidden inside loader names explicitly promised to be safe for untrusted input, which is a backdoor built into the advertised safe API rather than a documented unsafe option.

Source: kam193 (21f0c643e1ed1b11c56bfdd5f7567b2c0172924c227206b8ab9e4210918c6ee3)

In this campaign, remote code is executed via a dependency pretending to be a YAML loader but embedding a special loader executing code from a provided file. During analysis, the code was just a stub.


Category: MALICIOUS - The campaign has clearly malicious intent, like infostealers.

Campaign: 2026-11-parseyaml

Reasons (based on the campaign):

  • The malicious code is intentionally included in a dependency of the package

  • Downloads and executes a remote malicious script.

Database specific
{
    "iocs":  {
        "urls":  [
            "https://plainraw.com/raw/99b69bda4246"
        ]
    },
    "malicious-packages-origins":  [
        {
            "id":  "pypi/2026-11-parseyaml/parseyaml",
            "import_time":  "2026-11-08T22:36:34.682518859Z",
            "modified_time":  "2026-11-08T21:45:25.933688Z",
            "sha256":  "21f0c643e1ed1b11c56bfdd5f7567b2c0172924c227206b8ab9e4210918c6ee3",
            "source":  "kam193",
            "versions":  [
                "1.2.0"
            ]
        },
        {
            "id":  "IN-MAL-2026-022636",
            "import_time":  "2026-11-12T03:36:56.495828396Z",
            "modified_time":  "2026-11-12T03:35:38Z",
            "sha256":  "42b56cbea8e7b46f2ad7dc1d59334a45862f50366944ee198e97c68a313681ef",
            "source":  "amazon-inspector",
            "versions":  [
                "1.2.0"
            ]
        }
    ]
}
References
Credits

Affected packages

PyPI / parseyaml

Package

Affected ranges

Affected versions

1.*
1.2.0

Database specific

cwes
[
    {
        "cweId":  "CWE-506",
        "description":  "The product contains code that appears to be malicious in nature.",
        "name":  "Embedded Malicious Code"
    }
]
indicators
{
    "evidence_files":  [
        {
            "artifacts":  [
                "parseyaml-1.2.0.tar.gz",
                "parseyaml-1.2.0-py3-none-any.whl"
            ],
            "path":  "parseyaml/core.py",
            "sha256":  "acac40be1b8b623d2780ca0107d1496cc6840aff82fc1fafe714f8820ec840a9",
            "tlsh":  "acd13543e650ed924740deb5691afe42ada8bf470d0075b5bcacc12c9fda0adf0b45d8"
        }
    ],
    "package_integrity":  [
        {
            "filename":  "parseyaml-1.2.0-py3-none-any.whl",
            "hashes":  {
                "blake2b_256":  "c9d370fc0dcf046594bd36afa695732e0312c3e98eeb27fc7e4e3b9be4a57edf",
                "md5":  "9c8cbae2e8005002dcb2e11ee460b060",
                "sha256":  "9fe4bb1b97e5945c3d291465e32b325c3fbb0f0a50c92f9e925831296a47898d"
            }
        },
        {
            "filename":  "parseyaml-1.2.0.tar.gz",
            "hashes":  {
                "blake2b_256":  "6ba29e013de73cccde58773a53a842aaff7d685dd05134cc08754846710fe5b0",
                "md5":  "0060d69225b4f6d44cadc1a06c29b224",
                "sha256":  "5fe6da25a8b07825af947a478e9ce783386ce9504d8870c96a9e03aa284c405e"
            }
        }
    ]
}
source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/pypi/parseyaml/MAL-2026-18772.json"