{
  "schemaVersion": "ebb.rule.v1",
  "id": "npm.package.crypto-js.deprecated",
  "ecosystem": "npm",
  "purl": "pkg:npm/crypto-js",
  "affectedVersions": "vers:npm/*",
  "event": "deprecated",
  "severity": "high",
  "title": "crypto-js is deprecated",
  "summary": "npm marks crypto-js as deprecated: \"Active development of CryptoJS has been discontinued. This library is no longer maintained.\"",
  "replacement": "Web Crypto API (globalThis.crypto.subtle) or a maintained cryptography library",
  "sources": [
    {
      "title": "crypto-js on npm",
      "url": "https://www.npmjs.com/package/crypto-js",
      "accessedAt": "2026-10-19"
    },
    {
      "title": "crypto-js registry metadata",
      "url": "https://registry.npmjs.org/crypto-js/latest",
      "accessedAt": "2026-10-19"
    }
  ],
  "provenance": {
    "observedAt": "2026-10-19",
    "reviewedAt": "2026-10-19",
    "reviewer": "arminazimi"
  },
  "migration": {
    "constraints": [
      "Preserve the algorithms, modes, padding, key derivation, and output encodings each call site relies on, so data encrypted before the change still decrypts afterwards."
    ],
    "steps": [
      {
        "id": "audit-crypto-js-usages",
        "title": "Audit every cryptographic call",
        "instructions": "List each hash, cipher, KDF, HMAC, and encoding call with its algorithm, mode, padding, IV, and key size.",
        "targets": "usages"
      },
      {
        "id": "reimplement-with-maintained-crypto",
        "title": "Reimplement with a maintained implementation",
        "instructions": "Replace each call with the Web Crypto API or a maintained library that supports the same algorithms and parameters.",
        "targets": "usages"
      },
      {
        "id": "remove-crypto-js",
        "title": "Remove crypto-js",
        "instructions": "Remove crypto-js from dependencies and the lockfile once no call sites remain.",
        "targets": "declaration"
      }
    ],
    "verification": [
      {
        "command": "npm run test --if-present",
        "purpose": "Round-trip existing ciphertext and compare known-answer vectors in the repository tests."
      },
      {
        "command": "npm run build --if-present",
        "purpose": "Type-check and build every affected entry point."
      }
    ]
  }
}
