|
| 1 | +# CryptoJS |
| 2 | + |
| 3 | +Endless Lifecycle Support (ELS) for CryptoJS from TuxCare provides security fixes for CryptoJS versions that have reached their end of life. This allows you to continue running CryptoJS applications without vulnerability concerns, even after official support has ended. |
| 4 | + |
| 5 | + |
| 6 | +## Supported CryptoJS Versions |
| 7 | + |
| 8 | +* CryptoJS 3.3.0 |
| 9 | + |
| 10 | +## Connection to ELS for CryptoJS Library |
| 11 | + |
| 12 | +This guide outlines the steps needed to integrate the TuxCare ELS for the CryptoJS library. |
| 13 | + |
| 14 | +## Step 1: Get Token |
| 15 | + |
| 16 | +You need a token in order to use TuxCare ELS CryptoJS library. Anonymous access is disabled. To receive the token, please contact [[email protected]](mailto:[email protected]). |
| 17 | + |
| 18 | +## Step 2: Set Up ELS for CryptoJS |
| 19 | + |
| 20 | +TuxCare provides ELS for CryptoJS as an NPM package, hosted on a secure internal registry. Follow the steps below to add it to your project and get started. |
| 21 | + |
| 22 | +1. Navigate to the root directory of your CryptoJS project. |
| 23 | +2. Create a `.npmrc` file or update it if it already exists. |
| 24 | + |
| 25 | + **Example:** |
| 26 | + |
| 27 | + ```text |
| 28 | + my-crypto-js-project/ |
| 29 | + ├── node_modules/ |
| 30 | + ├── package.json |
| 31 | + ├── .npmrc ⚠️ ← Create it here |
| 32 | + └── package-lock.json |
| 33 | + ``` |
| 34 | + |
| 35 | +3. Use an editor of your choice (e.g., VS Code) to add the following registry address line: |
| 36 | + |
| 37 | + <CodeWithCopy> |
| 38 | + |
| 39 | + ```text |
| 40 | + registry=https://registry.npmjs.org/ |
| 41 | + @els-js:registry=https://nexus.repo.tuxcare.com/repository/els_js/ |
| 42 | + //nexus.repo.tuxcare.com/repository/els_js/:_auth=${TOKEN} |
| 43 | + ``` |
| 44 | + |
| 45 | + </CodeWithCopy> |
| 46 | + |
| 47 | + :::warning |
| 48 | + Replace ${TOKEN} with the token you received from [[email protected]](mailto:[email protected]). |
| 49 | + ::: |
| 50 | + |
| 51 | +4. Update your `package.json` file to replace your CryptoJS dependencies with the TuxCare packages: |
| 52 | + |
| 53 | + <CodeWithCopy> |
| 54 | + |
| 55 | + ```text |
| 56 | + "dependencies": { |
| 57 | + "crypto-js": "npm:@els-js/[email protected]" |
| 58 | + } |
| 59 | + ``` |
| 60 | + |
| 61 | + </CodeWithCopy> |
| 62 | + |
| 63 | +5. You need to remove the `node_modules` directory and the `package-lock.json` file, and also clear the `npm cache` before installing the patched packages. Use the following commands: |
| 64 | + |
| 65 | + <CodeWithCopy> |
| 66 | + |
| 67 | + ```text |
| 68 | + rm -rf node_modules package-lock.json && npm cache clean --force |
| 69 | + ``` |
| 70 | + |
| 71 | + </CodeWithCopy> |
| 72 | + |
| 73 | +6. Run the following command to install the ELS version of the CryptoJS library (token for the TuxCare repository will be automatically picked up from your `.npmrc` file): |
| 74 | + |
| 75 | + <CodeWithCopy> |
| 76 | + |
| 77 | + ```text |
| 78 | + npm install |
| 79 | + ``` |
| 80 | + |
| 81 | + </CodeWithCopy> |
| 82 | + |
| 83 | + You will see an output like: |
| 84 | + |
| 85 | + ```text |
| 86 | + added 1 package, and audited 2 packages in 815ms |
| 87 | +
|
| 88 | + found 0 vulnerabilities |
| 89 | + ``` |
| 90 | + |
| 91 | +7. You've successfully installed the Tuxcare ELS version of the CryptoJS library into your project. |
| 92 | + |
| 93 | +## Vulnerability Exploitability eXchange (VEX) |
| 94 | + |
| 95 | +VEX is a machine-readable format that tells you if a known vulnerability and is actually exploitable in your product. It reduces false positives, helps prioritize real risks. |
| 96 | + |
| 97 | +TuxCare provides VEX for CryptoJS ELS versions: [security.tuxcare.com/vex/cyclonedx/els_lang_javascript/crypto/](https://security.tuxcare.com/vex/cyclonedx/els_lang_javascript/crypto/). |
| 98 | + |
| 99 | +## How to Upgrade to a Newer Version of TuxCare Packages |
| 100 | + |
| 101 | +If you have already installed a package with a `tuxcare.1` suffix and want to upgrade to a newer release (for example, `tuxcare.32`), there are two options: |
| 102 | + |
| 103 | +* **Option 1**. Run the `npm install` command with the specific version. This will automatically update both `package.json` and `package-lock.json`: |
| 104 | + |
| 105 | + <CodeWithCopy> |
| 106 | + |
| 107 | + ```text |
| 108 | + npm install crypto-js@npm:@els-js/[email protected] |
| 109 | + ``` |
| 110 | + |
| 111 | + </CodeWithCopy> |
| 112 | + |
| 113 | +* **Option 2**. Update the version string in your `package.json`, remove installed files and clear npm cache to avoid conflicts: |
| 114 | + |
| 115 | + <CodeWithCopy> |
| 116 | + |
| 117 | + ```text |
| 118 | + rm -rf node_modules package-lock.json && npm cache clean --force |
| 119 | + npm install |
| 120 | + ``` |
| 121 | + |
| 122 | + </CodeWithCopy> |
0 commit comments