Skip to content
Heist/ feed
Unrated

Malicious code in common-fs (npm)

Type: advisorySource: OSV1 source record

--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (e3d99fa69df24bb5170c840f84e44038c20cf8b431c94abfd57eaa3701593684) common-fs advertises itself as a filesystem/transaction helper but ships an obfuscated code loader. index.js reconstructs the identifiers 'Function', 'Buffer', 'require', 'process', and 'setTimeout' from a shuffled string-array and obtains the Function constructor indirectly via global.constructor.constructor, hiding the eval sink from casual review. The documented getTransactions() entry point calls load_transaction_data(), which reads the sibling file use.js, treats it as a product catalog, concatenates the per-entry 'mark' fields in id order, applies a base64 + Caesar-shift decode followed by another base64 decode, and executes the resulting bytes with the Function constructor while injecting Buffer, require, and process. use.js is not data; it is the payload container, split across many small 'mark' fields to defeat string search. The moment a consumer calls the library's advertised API, attacker-controlled JavaScript runs in the caller's process with full access to require and process — enabling arbitrary code execution, filesystem access, and network exfiltration on the installer's host.

Announced Group revision 1
Original source ↗

MAL-2026-17300

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: osv:MAL-2026-17300

common-fs

Source reference: /affected/0/package/name

Affected versions
1.0.0

Source reference: /affected/0/versions

Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "package": {
      "name": "common-fs",
      "purl": "pkg:npm/common-fs",
      "ecosystem": "npm"
    },
    "versions": [
      "1.0.0"
    ],
    "database_specific": {
      "cwes": [
        {
          "name": "Embedded Malicious Code",
          "cweId": "CWE-506",
          "description": "The product contains code that appears to be malicious in nature."
        }
      ],
      "source": "https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/common-fs/MAL-2026-17300.json",
      "indicators": {
        "evidence_files": [
          {
            "path": "index.js",
            "tlsh": "83f10f6c39f930248857b07c67eb9449612de0576e9a6ca87f4d83101f7d13ce1f6ba8",
            "sha256": "72a7f942cc38326c29c48b536fa49f166c8d4d544b43da66893c2e9a59fffab0"
          },
          {
            "path": "use.js",
            "tlsh": "4e331f3acb780c5b91795a606af50a4af280471f17a16d877fbcd54c8fb1c5b804ab3b",
            "sha256": "65b54532c82855bbc8055c67d9f53854737ce01d3ae6b95fc6577204b81d953f"
          }
        ],
        "package_integrity": [
          {
            "hashes": {
              "sha1": "f1611cb60db31fe0bd5ab0c72e94bd05c0557cfe",
              "sha512_sri": "sha512-gZOgk2GPU3Eh2dcdKyMOAUaakS7XykK2QCgtOI3IMR+kkMO09+rC90uDXn8X8ALyZTtzkWa7bkIF4k5+1tDv5w=="
            },
            "filename": "common-fs-1.0.0.tgz"
          }
        ]
      }
    }
  }
]

Publisher severity

No explicit severity was provided.

Event
#33256 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement