MAL-2026-13627
Vulnerability from ossf_malicious_packages
Published
2026-08-07 18:02
Modified
2026-08-07 18:24
Summary
Malicious code in @nestjs-passport/jwt (npm)
Details

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

Source: amazon-inspector (0d3060c9289c475e223c1c00bc21a0f59f8aa5b18e31bfaee6e4d923eab0042f)

Package published under the @nestjs-passport scope, which resembles the official @nestjs/jwt and @nestjs/passport packages. The sole entrypoint files dist/index.cjs and dist/index.js each consist of a single-line JSFuck-encoded string (~2.3MB of permutations of!+[],!![], +[]) that is passed to new Function('jose', ) and invoked at require/import time, executing hidden code in the installer's Node process every time the module is loaded. The advertised purpose is a minimal HS256 JWT helper — a task requiring only a few lines of jose calls — and the shipped TypeScript declarations expose obfuscated private field names such as _0x5f2e and _0x4b19, inconsistent with the declared tsup build tooling. The combination of scope-level typosquat, whole-module JSFuck obfuscation, and dynamic evaluation of the obfuscated body at import time is a concealment-and-execution vehicle: whatever behavior the payload performs runs inside the installer's process without any traced-readable code path.

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": "dist/index.cjs",
              "sha256": "a2b64d639ffaaa3784eaf995d0ed16242280c47a4647fcd34e686dcf04769be6",
              "tlsh": "a3b51c0ec013e7d5f9cb55ec3ce4ae9d9b0e1e0bbaa4c76c2b4ca6974759ef06484811"
            },
            {
              "path": "dist/index.d.ts",
              "sha256": "65b212dab6b4946e63c2b0e76c1bf56558fad64f648d0eaed8c7ef11117e9b08",
              "tlsh": "67f08141d8d607701c938653afda0dc6e89cf20a654cbdf9ffe280514ac340ad07156a"
            }
          ],
          "package_integrity": [
            {
              "filename": "jwt-1.0.7.tgz",
              "hashes": {
                "sha1": "848c0e11f4d19efe132d6eb356d8121202affc98",
                "sha512_sri": "sha512-YbhPO2poNrFbEK0mWPHWiCsSYkf3Ys8Wr0dAQkx3qsMXq5i5Kr6yx2fulyJpgsPgY7fuY/BewNZSovHXie2lYg=="
              }
            }
          ]
        }
      },
      "package": {
        "ecosystem": "npm",
        "name": "@nestjs-passport/jwt"
      },
      "versions": [
        "1.0.7",
        "1.0.4"
      ]
    }
  ],
  "credits": [
    {
      "contact": [
        "inspector-research@amazon.com"
      ],
      "name": "Amazon Inspector",
      "type": "FINDER"
    }
  ],
  "database_specific": {
    "malicious-packages-origins": [
      {
        "id": "IN-MAL-2026-017136",
        "import_time": "2026-08-07T18:23:03.462193119Z",
        "modified_time": "2026-08-07T18:03:10Z",
        "sha256": "0d3060c9289c475e223c1c00bc21a0f59f8aa5b18e31bfaee6e4d923eab0042f",
        "source": "amazon-inspector",
        "versions": [
          "1.0.7"
        ]
      },
      {
        "id": "IN-MAL-2026-017135",
        "import_time": "2026-08-07T18:23:03.426426772Z",
        "modified_time": "2026-08-07T18:02:58Z",
        "sha256": "3118e2d469f173e01de26e12dca51e96b8c8e2a9c0d90d1476c3472d08f82193",
        "source": "amazon-inspector",
        "versions": [
          "1.0.4"
        ]
      }
    ]
  },
  "details": "\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (0d3060c9289c475e223c1c00bc21a0f59f8aa5b18e31bfaee6e4d923eab0042f)\nPackage published under the @nestjs-passport scope, which resembles the official @nestjs/jwt and @nestjs/passport packages. The sole entrypoint files dist/index.cjs and dist/index.js each consist of a single-line JSFuck-encoded string (~2.3MB of permutations of!+[],!![], +[]) that is passed to new Function(\u0027jose\u0027, \u003copaque body\u003e) and invoked at require/import time, executing hidden code in the installer\u0027s Node process every time the module is loaded. The advertised purpose is a minimal HS256 JWT helper \u2014 a task requiring only a few lines of jose calls \u2014 and the shipped TypeScript declarations expose obfuscated private field names such as _0x5f2e and _0x4b19, inconsistent with the declared tsup build tooling. The combination of scope-level typosquat, whole-module JSFuck obfuscation, and dynamic evaluation of the obfuscated body at import time is a concealment-and-execution vehicle: whatever behavior the payload performs runs inside the installer\u0027s process without any traced-readable code path.\n",
  "id": "MAL-2026-13627",
  "modified": "2026-08-07T18:24:51Z",
  "published": "2026-08-07T18:02:58Z",
  "references": [
    {
      "type": "PACKAGE",
      "url": "https://www.npmjs.com/package/@nestjs-passport/jwt/v/1.0.7"
    },
    {
      "type": "PACKAGE",
      "url": "https://www.npmjs.com/package/@nestjs-passport/jwt/v/1.0.4"
    }
  ],
  "schema_version": "1.7.4",
  "summary": "Malicious code in @nestjs-passport/jwt (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…