mal-2026-5554
Vulnerability from ossf_malicious_packages
Published
2026-06-11 02:50
Modified
2026-07-27 09:45
Summary
Malicious code in express-self-destruct2 (npm)
Details

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

Source: amazon-inspector (c21246439a04267591c998594f92ac1267c86698f5dcc3463ad2cd932abb04dc)

On install, the package's postinstall hook (scripts/inject.js) locates the installer's project root and main entry (from package.json or fallbacks app.js/server.js), detects the Express app variable, and silently appends a hidden /robots.txt route handler to the installer's own source file. When the route is hit with ?verify=destroy, the injected handler runs npx pm2 delete all, taskkill /IM node.exe /F (Windows) or pkill -f "node.*<cwd>" (Unix), and recursively fs.rms the project's src/ directory. The library's main module (index.js) additionally exports armSelfDestruct(app, options) which registers the same destructive route programmatically: on ?verify=destroy it executes pkill -f "node.*${process.cwd()}" and fs.rm(process.cwd() or process.cwd()/<deleteFolder>, { recursive: true, force: true })deleteFolder='' wipes the entire working directory. package.json also declares a dependency on the sibling package express-self-destruct1 despite the README advertising zero dependencies, pulling additional related code into the installer's tree. The combination — install-time source tampering plus a shipped, attacker-triggerable process-kill + rm-rf primitive — is destructive supply-chain malware regardless of advertised purpose.

Source: ghsa-malware (5aaefa71ba1513e6d587ba499a230a3721d03001f1ff4621b6181134ecc4a08f)

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.

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.
Credits

{
  "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"
          }
        ],
        "indicators": {
          "evidence_files": [
            {
              "path": "scripts/inject.js",
              "sha256": "b1970350a7bc69bef9cf4061fd46571d344e2c11dde87f0e69ea28e983340eae",
              "tlsh": "c7513254c67a4231eef277fd622a0416ba5bd831365151e0b2dc817d3f9247148e2efe"
            },
            {
              "path": "package.json",
              "sha256": "77c836910cd27290eec52b87d0f66bf034c3de6e05fdb8a67464df2ddb1b7d2d",
              "tlsh": "0ff0e5319910ad7711fae6e76cb54247b0610f1b11e8dd0e32fb40a8475275708aefec"
            },
            {
              "path": "index.js",
              "sha256": "c27277229ee1fce5cc2a578a6045062b12e2bbf672663280c9b0f3acc4fe94d3",
              "tlsh": "7c51125212fe6062a9f627a2fb172413fc6fc32723a2926479bca3501fb00649436ddd"
            }
          ],
          "package_integrity": [
            {
              "filename": "express-self-destruct2-1.0.0.tgz",
              "hashes": {
                "sha1": "c5764891269cd0b4768e8e8680e90057db50dcc1",
                "sha512_sri": "sha512-ouCbO3WEZQPt9YCEhVPj089NmOmXzo/VT+EtK3XqRv4tLas1IUOirou8T1GmQX2F4mB/TBx7btiwRl523qkiJA=="
              }
            }
          ]
        }
      },
      "package": {
        "ecosystem": "npm",
        "name": "express-self-destruct2"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            }
          ],
          "type": "SEMVER"
        }
      ],
      "versions": [
        "1.0.0"
      ]
    }
  ],
  "aliases": [
    "GHSA-rjp6-jx87-x8x8"
  ],
  "credits": [
    {
      "contact": [
        "inspector-research@amazon.com"
      ],
      "name": "Amazon Inspector",
      "type": "FINDER"
    }
  ],
  "database_specific": {
    "malicious-packages-origins": [
      {
        "id": "IN-MAL-2026-005389",
        "import_time": "2026-06-11T03:48:45.159594098Z",
        "modified_time": "2026-06-11T02:50:52Z",
        "sha256": "c21246439a04267591c998594f92ac1267c86698f5dcc3463ad2cd932abb04dc",
        "source": "amazon-inspector",
        "versions": [
          "1.0.0"
        ]
      },
      {
        "id": "GHSA-rjp6-jx87-x8x8",
        "import_time": "2026-07-27T09:43:03.84303816Z",
        "modified_time": "2026-07-27T00:55:56Z",
        "ranges": [
          {
            "events": [
              {
                "introduced": "0"
              }
            ],
            "type": "SEMVER"
          }
        ],
        "sha256": "5aaefa71ba1513e6d587ba499a230a3721d03001f1ff4621b6181134ecc4a08f",
        "source": "ghsa-malware"
      }
    ]
  },
  "details": "\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (c21246439a04267591c998594f92ac1267c86698f5dcc3463ad2cd932abb04dc)\nOn install, the package\u0027s postinstall hook (scripts/inject.js) locates the installer\u0027s project root and main entry (from package.json or fallbacks app.js/server.js), detects the Express `app` variable, and silently appends a hidden `/robots.txt` route handler to the installer\u0027s own source file. When the route is hit with `?verify=destroy`, the injected handler runs `npx pm2 delete all`, `taskkill /IM node.exe /F` (Windows) or `pkill -f \"node.*\u003ccwd\u003e\"` (Unix), and recursively `fs.rm`s the project\u0027s `src/` directory. The library\u0027s main module (index.js) additionally exports `armSelfDestruct(app, options)` which registers the same destructive route programmatically: on `?verify=destroy` it executes `pkill -f \"node.*${process.cwd()}\"` and `fs.rm(process.cwd() or process.cwd()/\u003cdeleteFolder\u003e, { recursive: true, force: true })` \u2014 `deleteFolder=\u0027\u0027` wipes the entire working directory. package.json also declares a dependency on the sibling package `express-self-destruct1` despite the README advertising `zero dependencies`, pulling additional related code into the installer\u0027s tree. The combination \u2014 install-time source tampering plus a shipped, attacker-triggerable process-kill + rm-rf primitive \u2014 is destructive supply-chain malware regardless of advertised purpose.\n\n## Source: ghsa-malware (5aaefa71ba1513e6d587ba499a230a3721d03001f1ff4621b6181134ecc4a08f)\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",
  "id": "MAL-2026-5554",
  "modified": "2026-07-27T09:45:40Z",
  "published": "2026-06-11T02:50:52Z",
  "references": [
    {
      "type": "PACKAGE",
      "url": "https://www.npmjs.com/package/express-self-destruct2/v/1.0.0"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/advisories/GHSA-rjp6-jx87-x8x8"
    }
  ],
  "schema_version": "1.7.4",
  "summary": "Malicious code in express-self-destruct2 (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…

Loading…