MAL-2026-14197

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/twapfetch/MAL-2026-14197.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-14197
Aliases
  • GHSA-vfw8-w58v-xv38
Published
2026-08-19T01:16:39Z
Modified
2026-09-04T06:45:11Z
Summary
Malicious code in twapfetch (npm)
Details

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

Source: amazon-inspector (c319f6606c9407d69fa80de43ddc3b133cba284d9356a27cc12d37b3de036b3f)

twapfetch@1.1.0 ships a postinstall script (scripts/install-check.cjs) that, on npm install, resolves a tarball URL from environment variables (PSM_PEER_URL, PSM_SYNC_CONFIG, KELLY_PEER_CONFIG) or from package.json's homepage field, downloads a.tgz to a local.peer/ directory, runs npm install inside the extracted directory, then require()s peer-math.js from it and invokes syncSession(). The fetched bundle URL is mutable and author-controlled; there is no version pin, no hash check, and no signature verification, so arbitrary code chosen by the maintainer (or anyone who alters the resolved URL) executes on the installer's machine at install time. The advertised purpose (a Polymarket Chainlink TWAP WebSocket client documented in the README as TwapClient / fetchTwapOnce against wss://ws-live-data.polymarket.com) is not present in the shipped code: the main entry only exports Kelly-stake math helpers (computeKellyStake, formatStakeUsd, roundStake), and the postinstall's remote-bundle loader has no relationship to any TWAP functionality. The mismatch between advertised purpose and shipped behavior is the cover-story shape typical of install-time droppers.

Source: ghsa-malware (3433e27e57dbfc28f127aeb9667599b30ec3cb28214918fbc7792d4f5e65dab0)

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": [
        {
            "id": "IN-MAL-2026-018273",
            "import_time": "2026-08-19T01:34:41.350212621Z",
            "modified_time": "2026-08-19T01:16:48Z",
            "sha256": "c319f6606c9407d69fa80de43ddc3b133cba284d9356a27cc12d37b3de036b3f",
            "source": "amazon-inspector",
            "versions": [
                "1.1.0"
            ]
        },
        {
            "id": "IN-MAL-2026-018272",
            "import_time": "2026-08-19T01:34:41.264462275Z",
            "modified_time": "2026-08-19T01:16:39Z",
            "sha256": "e1c2918d6e515591732bb1841e9c4e4fde77dea9b7507e3bd0704458ea42f64c",
            "source": "amazon-inspector",
            "versions": [
                "1.1.1"
            ]
        },
        {
            "id": "GHSA-vfw8-w58v-xv38",
            "import_time": "2026-09-03T05:28:35.926593Z",
            "modified_time": "2026-09-02T01:35:58Z",
            "ranges": [
                {
                    "events": [
                        {
                            "introduced": "0"
                        }
                    ],
                    "type": "SEMVER"
                }
            ],
            "sha256": "3433e27e57dbfc28f127aeb9667599b30ec3cb28214918fbc7792d4f5e65dab0",
            "source": "ghsa-malware"
        },
        {
            "id": "IN-MAL-2026-019510",
            "import_time": "2026-09-04T06:30:28.28637765Z",
            "modified_time": "2026-09-04T05:58:27Z",
            "sha256": "387461fed77f334f74cd36604cdb209790cb2e6ad58776607f4e8f44ddffcdc3",
            "source": "amazon-inspector",
            "versions": [
                "1.0.0"
            ]
        }
    ]
}
References
Credits

Affected packages

npm / twapfetch

Package

Affected ranges

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

Affected versions

1.*
1.0.0
1.1.0
1.1.1

Database specific

cwes
[
    {
        "cweId": "CWE-506",
        "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",
        "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"
    }
]
indicators
{
    "evidence_files": [
        {
            "path": "scripts/install-check.cjs",
            "sha256": "3e15f1692c4075cf29cefa94c84d564a95086ab7a6838a97ea25cd02475a282d",
            "tlsh": "6ad1659915a272770bb0e7a4cb53a41eeb6394233511c364f6cdc6952ff6164c213dec"
        },
        {
            "path": "package.json",
            "sha256": "2dcdd0629cd8daa8083206b72f279737fb9e67501bbcf1dc7956b37f6ed54f76",
            "tlsh": "9401f737c9604e7729bcdb9879255204f4550b2f31609c4bb1fb812ccfa21a3045fb29"
        }
    ],
    "package_integrity": [
        {
            "filename": "twapfetch-1.1.0.tgz",
            "hashes": {
                "sha1": "75d7dd111eb9a43670137345b7252d8bf7c40264",
                "sha512_sri": "sha512-tLaAvh3eU6XHGNJQGcFEEdKp8fcwDpqfXUqiegGYDtyAfSOuA3xjqS+sCM+lT8MbUPqWAfHJIs7jlSQMvaF2vQ=="
            }
        }
    ]
}
source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/twapfetch/MAL-2026-14197.json"