herozion 2.0.16 → 2.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_comment": "SHA-256 hashes for each platform binary. Auto-generated in CI from release CHECKSUMS.sha256. DO NOT edit manually.",
3
- "_version": "2.0.16",
4
- "herozion-linux-amd64": "a6f14d840c17e335bb1d34edb88ee9aad688db73595de8a0573091538bfc8796",
5
- "herozion-macos-amd64.tar.gz": "d2d99b9a51ccfcd533b8c7e62af924886ae5c090772a3ff43dbbed26ea3d9e02",
6
- "herozion-macos-arm64.tar.gz": "c29772a2ef54953e5a86a5dafb2e06cf456e5cc1765ff506f243d4d171ffe499",
7
- "herozion-windows-amd64.exe": "711328645a1e692e7f63e6eb86d77b0da8b4797c64e2ed743abf3fa7cc100d88"
3
+ "_version": "2.0.19",
4
+ "herozion-linux-amd64": "53779092e01cbe8352a8ff7e07f04dacc9cc9cacc9f0f867f88c1c6269b965f3",
5
+ "herozion-macos-amd64.tar.gz": "b74743df87d166b90245833dad35179651e4ad56db5b9fc1f65a6a539b6f2c98",
6
+ "herozion-macos-arm64.tar.gz": "7b019d734c5e5581c10c757fea559e2b759378e993eac829125e1ea0fb457aea",
7
+ "herozion-windows-amd64.exe": "c4925276768ea34fd6b92d96bb9d9fb59a9d623cb6837ff53fc37a0bc765272f"
8
8
  }
package/install.js CHANGED
@@ -268,9 +268,12 @@ async function main() {
268
268
  if (fs.existsSync(bundledChecksumsPath)) {
269
269
  try {
270
270
  const bundled = JSON.parse(fs.readFileSync(bundledChecksumsPath, "utf8"));
271
- bundledHash = (bundled[binaryName] || "").toLowerCase().trim();
271
+ bundledHash = bundledHashFor(bundled, binaryName, VERSION);
272
272
  if (!bundledHash) {
273
- console.warn(`herozion: WARNING — no bundled hash entry for ${binaryName}.`);
273
+ console.warn(
274
+ `herozion: WARNING — no bundled hash entry for ${binaryName} v${VERSION} ` +
275
+ `(checksums.json is for v${bundled._version || "?"}).`
276
+ );
274
277
  }
275
278
  } catch (parseErr) {
276
279
  console.warn(`herozion: WARNING — invalid checksums.json: ${parseErr.message}`);
@@ -350,6 +353,18 @@ function parseRemoteChecksum(checksumData, binaryName) {
350
353
  * A remote mismatch always rejects the binary. A failure to fetch the remote
351
354
  * file is fatal only when the bundled hash did not already match.
352
355
  */
356
+ /**
357
+ * Bundled hash for ``binaryName``, only when ``checksums.json`` was generated
358
+ * for this package version. A file left from another version (a source
359
+ * checkout of the tag, a stale build) must not be used as the trust anchor:
360
+ * its hashes belong to other binaries. Empty string → remote verification.
361
+ */
362
+ function bundledHashFor(bundled, binaryName, version) {
363
+ if (!bundled || typeof bundled !== "object") return "";
364
+ if (String(bundled._version || "") !== String(version)) return "";
365
+ return String(bundled[binaryName] || "").toLowerCase().trim();
366
+ }
367
+
353
368
  async function verifyChecksums({ actualHash, bundledHash, binaryName, readRemoteChecksums }) {
354
369
  let bundledVerified = false;
355
370
  let remoteVerified = false;
@@ -401,6 +416,7 @@ if (require.main === module) {
401
416
 
402
417
  module.exports = {
403
418
  _isRedirect,
419
+ bundledHashFor,
404
420
  download,
405
421
  downloadText,
406
422
  parseRemoteChecksum,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "herozion",
3
- "version": "2.0.16",
3
+ "version": "2.0.19",
4
4
  "description": "Security audit and performance analysis CLI tool for developers",
5
5
  "keywords": [
6
6
  "security",
@@ -33,7 +33,7 @@
33
33
  "preuninstall": "node uninstall.js"
34
34
  },
35
35
  "engines": {
36
- "node": ">=16.0.0"
36
+ "node": ">=22"
37
37
  },
38
38
  "publishConfig": {
39
39
  "access": "public"