MAL-2026-5346

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/cookie-parser-legacy/MAL-2026-5346.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-5346
Aliases
  • GHSA-xv3p-wcmf-6hp8
Published
2026-06-09T11:19:47Z
Modified
2026-07-08T23:01:47.763212230Z
Summary
Malicious code in cookie-parser-legacy (npm)
Details

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

Source: amazon-inspector (53a673e0454bb102d4e8456e3c26290196c5ae5bf4cf9438ce78f8286fd5c3be)

Package name and README impersonate the well-known cookie-parser Express middleware. The source is a near-verbatim copy of cookie-parser, except the legitimate cookie-signature dependency has been replaced with an unknown package moustick pinned to the mutable latest tag (package.json: "moustick": "latest"). index.js requires moustick as signature and invokes signature.unsign(str.slice(2), secrets[i]) at request time on user-supplied cookie values, executing whatever code moustick currently publishes against installer-side cookie secrets and signed values. index.js additionally imports execSync from child_process at the top of the file with no reference anywhere in the cookie-parsing logic — an unusual staging artifact for a pure parsing module. The combination of name-impersonation of a top-tier middleware, silent substitution of a security-critical dependency, and pinning that substitute to a mutable tag means any installer who picks this up thinking it is cookie-parser will resolve and execute arbitrary third-party code controlled by the moustick publisher on every install.

Source: ghsa-malware (1b0e373057d636dbc4939fdb3e1f8cda1276c8bb88ae02f5ed156244e12fdb91)

Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.

Database specific
{
    "malicious-packages-origins": [
        {
            "ranges": [
                {
                    "type": "SEMVER",
                    "events": [
                        {
                            "introduced": "0"
                        }
                    ]
                }
            ],
            "id": "GHSA-xv3p-wcmf-6hp8",
            "source": "ghsa-malware",
            "import_time": "2026-06-09T11:22:38.40056144Z",
            "sha256": "1b0e373057d636dbc4939fdb3e1f8cda1276c8bb88ae02f5ed156244e12fdb91",
            "modified_time": "2026-06-09T11:19:48Z"
        },
        {
            "sha256": "53a673e0454bb102d4e8456e3c26290196c5ae5bf4cf9438ce78f8286fd5c3be",
            "id": "IN-MAL-2026-005845",
            "source": "amazon-inspector",
            "import_time": "2026-06-12T19:43:39.508812201Z",
            "modified_time": "2026-06-12T19:03:09Z",
            "versions": [
                "1.5.4"
            ]
        },
        {
            "sha256": "865049d4fed50032d3c36e8e758ffa9177d0ae0e9e90b9e09096c50f3c660e6e",
            "id": "IN-MAL-2026-005844",
            "source": "amazon-inspector",
            "import_time": "2026-06-12T19:43:39.377064674Z",
            "modified_time": "2026-06-12T19:03:07Z",
            "versions": [
                "1.5.3"
            ]
        },
        {
            "modified_time": "2026-07-08T22:35:00Z",
            "id": "IN-MAL-2026-008800",
            "source": "amazon-inspector",
            "import_time": "2026-07-08T22:51:21.811257906Z",
            "sha256": "5c6f43b710662318a9b7b583c0a4d809ff987ee524be02193b5ce47e88fcfb38",
            "versions": [
                "1.5.2"
            ]
        },
        {
            "modified_time": "2026-07-08T22:35:34Z",
            "id": "IN-MAL-2026-008804",
            "source": "amazon-inspector",
            "import_time": "2026-07-08T22:51:22.257119705Z",
            "sha256": "5def09fe1321d0d0ca7e8e718dc95499b9678bf93a9a084d03afdae4e7839ded",
            "versions": [
                "1.5.1"
            ]
        }
    ]
}
References
Credits

Affected packages

npm / cookie-parser-legacy

Package

Name
cookie-parser-legacy
View open source insights on deps.dev
Purl
pkg:npm/cookie-parser-legacy

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected

Affected versions

1.*
1.5.1
1.5.2
1.5.3
1.5.4

Database specific

indicators
{
    "evidence_files": [
        {
            "path": "package.json",
            "tlsh": "99219a33d5880d6342f496a9bc7812c2f052574f41a2dc0fb5b9231c8fb36a348a6fb9",
            "sha256": "39ed3e08ef583d1cc977d7ef6a1e85a94565524acc077a97bf4de5af0123041f"
        },
        {
            "path": "index.js",
            "tlsh": "6c71d2d938bba00e91b76a33f9ca411af655482311599058f8d5f5b02fa480bca7cdcb",
            "sha256": "5d48941fdbbd82468aa69183467dd5204761d96a142a446a5eb4f98e30291fd4"
        }
    ]
}
source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/cookie-parser-legacy/MAL-2026-5346.json"
cwes
[
    {
        "description": "The product contains code that appears to be malicious in nature.",
        "cweId": "CWE-506",
        "name": "Embedded Malicious Code"
    },
    {
        "description": "The product contains code that appears to be malicious in nature.",
        "cweId": "CWE-506",
        "name": "Embedded Malicious Code"
    },
    {
        "description": "The product contains code that appears to be malicious in nature.",
        "cweId": "CWE-506",
        "name": "Embedded Malicious Code"
    },
    {
        "description": "The product contains code that appears to be malicious in nature.",
        "cweId": "CWE-506",
        "name": "Embedded Malicious Code"
    },
    {
        "description": "The product contains code that appears to be malicious in nature.",
        "cweId": "CWE-506",
        "name": "Embedded Malicious Code"
    }
]