MAL-2026-5318

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/pypi/langchain-core-mcp/MAL-2026-5318.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-5318
Published
2026-06-06T06:13:57Z
Modified
2026-06-11T08:01:34.495640028Z
Summary
Malicious code in langchain-core-mcp (PyPI)
Details

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

Source: amazon-inspector (bd42d83950d8d8fc559905eed104af38cd6c8aef683b96778f0b8d778dd6bd5a)

Package langchain-core-mcp impersonates the legitimate langchain-core publisher: METADATA sets Project-URL Repository to https://github.com/langchain-ai/langchain and reproduces the upstream README/description verbatim. On install, the package drops two.pth files at the site-packages root — langchain_core-setup.pth (notably using the legitimate package's name) and langchain_core_mcp-setup.pth — both of which Python auto-loads on every interpreter start. The.pth payload is obfuscated into a single line using single-letter aliases (_O, _T, _u, _s, _b, _j, _z,...) and wrapped in exec('...') to evade simple grep-based scanners. When executed, the code creates a sentinel at /tmp/.bun_ran, downloads the Bun runtime ZIP from https://github.com/oven-sh/bun/releases/download/bun-v1.3.13/bun-{platform}-{arch}.zip via urllib.request.urlretrieve to /tmp/b/bun, extracts and chmods +x, then spawns bun run _index.js in the background against the bundled 5.35 MB langchain_core_mcp/_index.js payload. The use of an alien JS runtime (Bun) to execute an opaque bundled payload bypasses Python-only inspection; auto-execution via.pth bypasses pip build isolation and fires on every Python interpreter launch on the installer's machine, not just on import of this package.

Source: kam193 (ccea64b925d1d7ce4f42ceaeeb77320244fd0c3714ed6c605428e90d42956f96)

Versions 1.4.2, 1.4.3 were compromised.

Compromised packages start an obfuscated infostealer. The infostealer is a heavily obfuscated JavaScript code executed using Bun runtime on Python startup. It collectes all kinds of sensitive data, including API keys, credentials to package repositories, cryptocurrency assets, password manager data. Infostealer actively queries online services to collect additional secrets as well as attempts to gain persistence and spread further by publishing infected packages using collected credentials. Data are exfiltrated likely using Github. The code seems to threaten to wipe the user's data if it detects invalid GitHub tokens. Cleanup should be done with caution.

It seems to be related to the recent Mini Shai Hulud campaign.


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

Campaign: 2026-06-compr-woodpecker

Reasons (based on the campaign):

  • compromised-package

  • exfiltration-env-variables

  • exfiltration-cloud-tokens

  • exfiltration-credentials

  • abuses-pth

  • obfuscation

  • infostealer

  • The package contains code to detect if it is running in a sandbox environment.

  • exfiltration-crypto

  • files-exfiltration

  • destructive-actions

Database specific
{
    "malicious-packages-origins": [
        {
            "versions": [
                "1.4.2",
                "1.4.3"
            ],
            "sha256": "ccea64b925d1d7ce4f42ceaeeb77320244fd0c3714ed6c605428e90d42956f96",
            "modified_time": "2026-06-06T06:13:57Z",
            "source": "kam193",
            "id": "pypi/2026-06-compr-woodpecker/langchain-core-mcp",
            "import_time": "2026-06-08T11:41:02.527543875Z"
        },
        {
            "versions": [
                "1.4.2",
                "1.4.3"
            ],
            "sha256": "c3ddf8b245e4cd5c0030820746ec600528f74841c1b2143b9c287eb9ecd132fa",
            "modified_time": "2026-06-08T10:07:51Z",
            "source": "kam193",
            "id": "pypi/2026-06-compr-woodpecker/langchain-core-mcp",
            "import_time": "2026-06-08T19:19:19.182764479Z"
        },
        {
            "versions": [
                "1.4.2",
                "1.4.3"
            ],
            "sha256": "0176ed5978bd6b152fb3e8b99fe973aa4e82af218340401089f3febebfa19ddf",
            "source": "kam193",
            "modified_time": "2026-06-08T10:07:51Z",
            "import_time": "2026-06-09T07:48:29.642054067Z",
            "id": "pypi/2026-06-compr-woodpecker/langchain-core-mcp"
        },
        {
            "versions": [
                "1.4.3"
            ],
            "sha256": "bd42d83950d8d8fc559905eed104af38cd6c8aef683b96778f0b8d778dd6bd5a",
            "modified_time": "2026-06-11T04:44:31Z",
            "source": "amazon-inspector",
            "import_time": "2026-06-11T05:40:57.732145902Z",
            "id": "IN-MAL-2026-005466"
        },
        {
            "versions": [
                "1.4.2"
            ],
            "sha256": "582996fb0cf299f73f174ff284c6486392265b1fe39d6be2880ac94877035aa0",
            "modified_time": "2026-06-11T06:33:57Z",
            "source": "amazon-inspector",
            "import_time": "2026-06-11T07:49:35.268420128Z",
            "id": "IN-MAL-2026-005636"
        }
    ]
}
References
Credits

Affected packages

PyPI / langchain-core-mcp

Package

Name
langchain-core-mcp
View open source insights on deps.dev
Purl
pkg:pypi/langchain-core-mcp

Affected ranges

Affected versions

1.*
1.4.2
1.4.3

Database specific

indicators
{
    "package_integrity": [
        {
            "filename": "langchain_core_mcp-1.4.3-py3-none-any.whl",
            "hashes": {
                "sha256": "8ba657716b25bfb74e7fc69afb8c5e4a76a177385ea1fa360d9df3fbf74fa60d",
                "md5": "9d1bb4d2bc0874fe839f826bdf0956a6",
                "blake2b_256": "51defc5e079bf959bc729044aa0bf8139e87567689d59ee9611ed2a5929ef77a"
            }
        }
    ],
    "evidence_files": [
        {
            "sha256": "6506d31707a39949f89534bf9705bcf889f1ecae3dbc6f4ff88d67a8be3d01b2",
            "path": "langchain_core-setup.pth",
            "tlsh": "8721015780038160da72d627cb2929f4278b0cbb4e538b1b8de8d9c172d0d1197b6b48"
        },
        {
            "sha256": "0fcc111eace56547deabac87428119abc6744877924e49aa3f69d5ff4a3e275b",
            "path": "langchain_core_mcp-1.4.3.dist-info/METADATA",
            "tlsh": "c291fff353c45ae44bc309cb92296688f633e578e989e4ed9f76402dc5115a2c23b4ed"
        }
    ]
}
source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/pypi/langchain-core-mcp/MAL-2026-5318.json"
cwes
[
    {
        "description": "The product contains code that appears to be malicious in nature.",
        "name": "Embedded Malicious Code",
        "cweId": "CWE-506"
    },
    {
        "description": "The product contains code that appears to be malicious in nature.",
        "name": "Embedded Malicious Code",
        "cweId": "CWE-506"
    }
]