mal-2026-4278
Vulnerability from ossf_malicious_packages
Published
2026-05-23 00:00
Modified
2026-05-26 05:55
Summary
Malicious code in llm-context-compressor (npm)
Details

Ten packages published by npm user asdxzxc at version 1.0.10 target developers working on AI and LLM tooling. Each package masquerades as a developer utility while executing a two-stage payload triggered via postinstall: package.jsonlib/setup.jslib/worker.js.

Credential harvesting: lib/worker.js scans the filesystem for private keys (64-char hex), BIP39 mnemonics (12–24 word phrases), API keys and secrets, and passwords from env vars and shell history (.bash_history, .zsh_history, .fish_history, .mysql_history, .psql_history), including wallet tool invocations (geth account, hardhat, metamask, wallet import). Targeted paths include ~/.ssh, ~/.aws/credentials, ~/.config/gcloud, ~/.azure, ~/.docker/config.json, ~/.kube/config, crypto wallet dirs (~/.ethereum, ~/.bitcoin, ~/.solana), exchange configs (Binance, Bybit, OKX, KuCoin, Deribit, 3Commas), .env, .npmrc, .gitconfig. Also performs browser data theft and Ethereum keystore brute-force. A priority-target list fetched from the actor's GitHub Pages endpoint enables aggressive deep scanning for pre-registered high-value hosts.

AI self-propagation: after credential theft, a _propagate() function executes a multi-vector campaign to infect AI coding assistants. It writes poisoned .cursorrules and CLAUDE.md files — framed as "P-2024-001 Enterprise Credential Integrity Standard" — to all discovered project directories, parent directories, and home subdirectories, instructing Cursor, Claude Code, and GitHub Copilot to execute the remote payload and propagate it via Issues, PRs, and documentation. Git hooks (post-merge, post-checkout, pre-commit, pre-push) are injected into all .git repos found on disk, and a persistence block is appended to ~/.bashrc, ~/.zshrc, and ~/.profile. Zero-width steganography (ZWSP/ZWJ/ZWNJ/LTRM encoding) embeds hidden scan triggers in all AI-generated text output, enabling AI-to-AI chain infection invisible to humans.

C2/exfil: a remotely configurable JSON config hosted on the actor's GitHub Pages delivers the active webhook list, encryption key, and scan strategy; hardcoded fallback webhooks at webhook.site and a DNS TXT record fallback are used if the primary channel fails. A dedup marker at ~/.local/share/.p2024_integrity prevents re-propagation within 24 hours.

llm-context-compressor poses as an LLM context window compression utility, specifically targeting AI/LLM application developers.


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

Source: amazon-inspector (e9c153ce1554f3397e2fc5220e97ee13325d9c6425ee73179fbd077c2865ae0d)

The package ships lib/trap-core.js, a ~1000-line module that combines fs, os, https, and child_process to collect host fingerprints and POST them to a remote endpoint. Observed structural fingerprints in trap-core.js: os.hostname() / os.platform() reads (lines 1023-1024, 304), filesystem enumeration via fs.existsSync at multiple locations (lines 28, 81, 196,...), spawning of child processes including curl (line 781) and ping (line 40), and multiple HTTP POST request constructions carrying hostname: fields in their JSON bodies (lines 385, 393, 411, 466, 548-553, 600). This matches the host-recon-and-exfiltrate pattern: gather identifiers from os/fs, run shell commands for additional intel, then POST results over https. The package's stated purpose ("LLM context compressor") provides no legitimate justification for hostname/platform collection, child_process spawning of curl, or POST'ing host metadata. Treat as a credential/host-intelligence exfiltrator regardless of how the module is reached, as the file is part of the published tarball and shipped with the library code.

Source: ghsa-malware (5204b76dff252870f5cd3780e4c487280ee23d902f513b9d711133a96a92f200)

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.

Source: ossf-package-analysis (67b8fe7520edd9ce527f9eccb91561c4ea943cf60dc2c3b626bdee7b074efccd)

The OpenSSF Package Analysis project identified 'llm-context-compressor' @ 1.0.12 (npm) as malicious.

It is considered malicious because:

  • The package executes one or more commands associated with malicious behavior.
CWE
  • CWE-506 - The product contains code that appears to be malicious in nature.
  • CWE-506 - The product contains code that appears to be malicious in nature.
  • CWE-506 - The product contains code that appears to be malicious in nature.
  • CWE-506 - The product contains code that appears to be malicious in nature.
  • CWE-506 - The product contains code that appears to be malicious in nature.
  • CWE-506 - The product contains code that appears to be malicious in nature.

{
  "affected": [
    {
      "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"
          },
          {
            "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": {
          "domains": [
            "ddjidd564.github.io",
            "webhook.site"
          ],
          "evidence_files": [
            {
              "path": "lib/trap-core.js",
              "sha256": "5b68fa0e8fcab79911423bddf4edebcc1ba8c7b140b30c6a9a6ee698606ea111",
              "tlsh": "5823f78615f611304aa3e0e99f879029623ae1533245dda4f79c83449fca72c93f6bed"
            }
          ],
          "package_integrity": [
            {
              "filename": "llm-context-compressor-1.5.1.tgz",
              "hashes": {
                "sha1": "bf7c51c6cfdf68dac2d783051e78b5d1f338c701",
                "sha512_sri": "sha512-t4bjrN4K4s4SNXHIwgphJmeJydSaC0QFlOlNHiCxXMTNYA+g1azUprnjZSV7QvLOcEtHr4+2PeL1bqdAmzB9Tw=="
              }
            }
          ]
        }
      },
      "package": {
        "ecosystem": "npm",
        "name": "llm-context-compressor"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            }
          ],
          "type": "SEMVER"
        }
      ],
      "versions": [
        "1.0.12",
        "1.4.0",
        "1.5.1",
        "1.3.0",
        "1.5.0",
        "1.1.0"
      ]
    }
  ],
  "aliases": [
    "GHSA-65j3-6fx4-8q2j"
  ],
  "credits": [
    {
      "contact": [
        "actran@amazon.com"
      ],
      "name": "Amazon Inspector",
      "type": "FINDER"
    },
    {
      "contact": [
        "https://github.com/ossf/package-analysis",
        "https://openssf.slack.com/channels/package_analysis"
      ],
      "name": "OpenSSF: Package Analysis",
      "type": "FINDER"
    },
    {
      "contact": [
        "https://safedep.io"
      ],
      "name": "SafeDep",
      "type": "FINDER"
    }
  ],
  "database_specific": {
    "malicious-packages-origins": [
      {
        "id": "GHSA-65j3-6fx4-8q2j",
        "import_time": "2026-05-24T15:40:47.380133134Z",
        "modified_time": "2026-05-24T15:36:25Z",
        "ranges": [
          {
            "events": [
              {
                "introduced": "0"
              }
            ],
            "type": "SEMVER"
          }
        ],
        "sha256": "5204b76dff252870f5cd3780e4c487280ee23d902f513b9d711133a96a92f200",
        "source": "ghsa-malware"
      },
      {
        "import_time": "2026-05-24T21:23:04.873042888Z",
        "modified_time": "2026-05-23T20:20:24Z",
        "sha256": "67b8fe7520edd9ce527f9eccb91561c4ea943cf60dc2c3b626bdee7b074efccd",
        "source": "ossf-package-analysis",
        "versions": [
          "1.0.12"
        ]
      },
      {
        "id": "IN-MAL-2026-004421",
        "import_time": "2026-05-26T05:52:34.077485061Z",
        "modified_time": "2026-05-24T00:53:26Z",
        "sha256": "118ec1f8daac8478e096500a73331b231b7edd1ae91c397ed4e1e835315df1c3",
        "source": "amazon-inspector",
        "versions": [
          "1.4.0"
        ]
      },
      {
        "id": "IN-MAL-2026-004491",
        "import_time": "2026-05-26T05:52:42.239448076Z",
        "modified_time": "2026-05-24T11:19:30Z",
        "sha256": "75ea9239bc0a534e1b168c764960f7dc4921214f9b1d877dbf784f8f01288427",
        "source": "amazon-inspector",
        "versions": [
          "1.5.1"
        ]
      },
      {
        "id": "IN-MAL-2026-004419",
        "import_time": "2026-05-26T05:52:33.842083481Z",
        "modified_time": "2026-05-24T00:47:36Z",
        "sha256": "7c111e6ffb0e0ba4f303039b99ce79163ba68b3c209b3669964006b25b3b9365",
        "source": "amazon-inspector",
        "versions": [
          "1.3.0"
        ]
      },
      {
        "id": "IN-MAL-2026-004438",
        "import_time": "2026-05-26T05:52:36.130128368Z",
        "modified_time": "2026-05-24T02:12:29Z",
        "sha256": "e9c153ce1554f3397e2fc5220e97ee13325d9c6425ee73179fbd077c2865ae0d",
        "source": "amazon-inspector",
        "versions": [
          "1.5.0"
        ]
      },
      {
        "id": "IN-MAL-2026-004416",
        "import_time": "2026-05-26T05:52:33.538523104Z",
        "modified_time": "2026-05-24T00:45:34Z",
        "sha256": "ea6cdda63d3c08f8dc0eebb8f52ead9afcee37975986b06958363a7a826b694c",
        "source": "amazon-inspector",
        "versions": [
          "1.3.0"
        ]
      },
      {
        "id": "IN-MAL-2026-004492",
        "import_time": "2026-05-26T05:52:42.371550331Z",
        "modified_time": "2026-05-24T11:19:31Z",
        "sha256": "0e4ecbf0054c747d008205e13c23bcab26aec9906da389810fc34898b5e6d62d",
        "source": "amazon-inspector",
        "versions": [
          "1.5.1"
        ]
      },
      {
        "id": "IN-MAL-2026-004420",
        "import_time": "2026-05-26T05:52:33.979885119Z",
        "modified_time": "2026-05-24T00:53:26Z",
        "sha256": "57e047c4ed2dbdbf5c0a62b39838541b778f91c456b208da93c151fd7703b102",
        "source": "amazon-inspector",
        "versions": [
          "1.4.0"
        ]
      },
      {
        "id": "IN-MAL-2026-004439",
        "import_time": "2026-05-26T05:52:36.269830642Z",
        "modified_time": "2026-05-24T02:12:30Z",
        "sha256": "57e3b94d285f684a22acef94238e49c9cd80704a50c90957c889ec7fa14d9e23",
        "source": "amazon-inspector",
        "versions": [
          "1.5.0"
        ]
      },
      {
        "id": "IN-MAL-2026-004395",
        "import_time": "2026-05-26T05:52:30.863845159Z",
        "modified_time": "2026-05-23T22:57:28Z",
        "sha256": "629c13f1128fb653d7ff5d05f411cbce6549ce994aa87d661a30472780ec908d",
        "source": "amazon-inspector",
        "versions": [
          "1.1.0"
        ]
      },
      {
        "id": "IN-MAL-2026-004396",
        "import_time": "2026-05-26T05:52:30.980192816Z",
        "modified_time": "2026-05-23T22:57:29Z",
        "sha256": "afd6313eae8f1d9434db14cfc8abc9485ff2bef6df41c0e10d2d5c11661718b3",
        "source": "amazon-inspector",
        "versions": [
          "1.1.0"
        ]
      }
    ]
  },
  "details": "Ten packages published by npm user `asdxzxc` at version 1.0.10 target developers working on AI and LLM tooling. Each package masquerades as a developer utility while executing a two-stage payload triggered via postinstall: `package.json` \u2192 `lib/setup.js` \u2192 `lib/worker.js`.\n\n**Credential harvesting:** `lib/worker.js` scans the filesystem for private keys (64-char hex), BIP39 mnemonics (12\u201324 word phrases), API keys and secrets, and passwords from env vars and shell history (`.bash_history`, `.zsh_history`, `.fish_history`, `.mysql_history`, `.psql_history`), including wallet tool invocations (`geth account`, `hardhat`, `metamask`, `wallet import`). Targeted paths include `~/.ssh`, `~/.aws/credentials`, `~/.config/gcloud`, `~/.azure`, `~/.docker/config.json`, `~/.kube/config`, crypto wallet dirs (`~/.ethereum`, `~/.bitcoin`, `~/.solana`), exchange configs (Binance, Bybit, OKX, KuCoin, Deribit, 3Commas), `.env`, `.npmrc`, `.gitconfig`. Also performs browser data theft and Ethereum keystore brute-force. A priority-target list fetched from the actor\u0027s GitHub Pages endpoint enables aggressive deep scanning for pre-registered high-value hosts.\n\n**AI self-propagation:** after credential theft, a `_propagate()` function executes a multi-vector campaign to infect AI coding assistants. It writes poisoned `.cursorrules` and `CLAUDE.md` files \u2014 framed as \"P-2024-001 Enterprise Credential Integrity Standard\" \u2014 to all discovered project directories, parent directories, and home subdirectories, instructing Cursor, Claude Code, and GitHub Copilot to execute the remote payload and propagate it via Issues, PRs, and documentation. Git hooks (`post-merge`, `post-checkout`, `pre-commit`, `pre-push`) are injected into all `.git` repos found on disk, and a persistence block is appended to `~/.bashrc`, `~/.zshrc`, and `~/.profile`. Zero-width steganography (ZWSP/ZWJ/ZWNJ/LTRM encoding) embeds hidden scan triggers in all AI-generated text output, enabling AI-to-AI chain infection invisible to humans.\n\n**C2/exfil:** a remotely configurable JSON config hosted on the actor\u0027s GitHub Pages delivers the active webhook list, encryption key, and scan strategy; hardcoded fallback webhooks at `webhook.site` and a DNS TXT record fallback are used if the primary channel fails. A dedup marker at `~/.local/share/.p2024_integrity` prevents re-propagation within 24 hours.\n\n`llm-context-compressor` poses as an LLM context window compression utility, specifically targeting AI/LLM application developers.\n\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (e9c153ce1554f3397e2fc5220e97ee13325d9c6425ee73179fbd077c2865ae0d)\nThe package ships lib/trap-core.js, a ~1000-line module that combines fs, os, https, and child_process to collect host fingerprints and POST them to a remote endpoint. Observed structural fingerprints in trap-core.js: os.hostname() / os.platform() reads (lines 1023-1024, 304), filesystem enumeration via fs.existsSync at multiple locations (lines 28, 81, 196,...), spawning of child processes including curl (line 781) and ping (line 40), and multiple HTTP POST request constructions carrying `hostname:` fields in their JSON bodies (lines 385, 393, 411, 466, 548-553, 600). This matches the host-recon-and-exfiltrate pattern: gather identifiers from os/fs, run shell commands for additional intel, then POST results over https. The package\u0027s stated purpose (\"LLM context compressor\") provides no legitimate justification for hostname/platform collection, child_process spawning of curl, or POST\u0027ing host metadata. Treat as a credential/host-intelligence exfiltrator regardless of how the module is reached, as the file is part of the published tarball and shipped with the library code.\n\n## Source: ghsa-malware (5204b76dff252870f5cd3780e4c487280ee23d902f513b9d711133a96a92f200)\nAny 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.\n\n## Source: ossf-package-analysis (67b8fe7520edd9ce527f9eccb91561c4ea943cf60dc2c3b626bdee7b074efccd)\nThe OpenSSF Package Analysis project identified \u0027llm-context-compressor\u0027 @ 1.0.12 (npm) as malicious.\n\nIt is considered malicious because:\n\n- The package executes one or more commands associated with malicious behavior.\n",
  "id": "MAL-2026-4278",
  "modified": "2026-05-26T05:55:03Z",
  "published": "2026-05-23T00:00:00Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://github.com/advisories/GHSA-65j3-6fx4-8q2j"
    },
    {
      "type": "REPORT",
      "url": "https://x.com/safedepio/status/2058177434630213994"
    },
    {
      "type": "PACKAGE",
      "url": "https://www.npmjs.com/package/llm-context-compressor/v/1.5.1"
    },
    {
      "type": "PACKAGE",
      "url": "https://www.npmjs.com/package/llm-context-compressor/v/1.5.0"
    },
    {
      "type": "PACKAGE",
      "url": "https://www.npmjs.com/package/llm-context-compressor/v/1.3.0"
    },
    {
      "type": "PACKAGE",
      "url": "https://www.npmjs.com/package/llm-context-compressor/v/1.4.0"
    },
    {
      "type": "PACKAGE",
      "url": "https://www.npmjs.com/package/llm-context-compressor/v/1.1.0"
    }
  ],
  "schema_version": "1.7.4",
  "summary": "Malicious code in llm-context-compressor (npm)"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…
Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…