Skip to content

fix(deps): bump adm-zip to 0.6.0 and override qs to 6.16.0 (+Claude) - #227

Merged
dhruv-parekh-cs merged 7 commits into
developmentfrom
CL-snyk-fixes/31-Aug-2026
Aug 31, 2026
Merged

fix(deps): bump adm-zip to 0.6.0 and override qs to 6.16.0 (+Claude)#227
dhruv-parekh-cs merged 7 commits into
developmentfrom
CL-snyk-fixes/31-Aug-2026

Conversation

@dhruv-parekh-cs

@dhruv-parekh-cs dhruv-parekh-cs commented Aug 31, 2026

Copy link
Copy Markdown

Snyk fix routine — 31-Aug-2026

Automated dependency-vulnerability remediation pass. Surface in scope: Node.js.

Fix summary

Issue Severity Package Before → After Bucket Rationale
GHSA-xcpc-8h2w-3j85 / CVE-2026-39244 — crafted ZIP triggers unbounded Buffer.alloc (4GB allocation → OOM) high adm-zip (direct dependency) ^0.5.18^0.6.0 fixable Only patched in 0.6.0, which upstream flags as breaking — see the adaptation section below for why it is safe here. Caret floors the fix while leaving future 0.6.x patches free.
CVE-2026-82562 — Allocation of Resources Without Limits or Throttling (2 paths) medium qs (override) ^6.15.2^6.16.0 stale override raised An existing override's floor sat below the patched version, so it was holding the tree back. Advisory range >=6.14.2 <6.16.0; the whole 6 major is patched at that floor, so ^6.16.0. Reached via express@4.22.2 › qs.
@types/adm-zip (devDependency) ^0.5.7removed cleanup required by the bump adm-zip@0.6.0 ships its own types.d.ts, which takes precedence. Leaving the stale @types package at 0.5.x meant two competing declarations for the same module.

Application-code change — please review closely

src/adapters/file-upload.ts, archive() — one adaptation was required by the adm-zip major.

In 0.6.0 the bundled types declare writeZipPromise(): Promise<void> (0.5.x's @types said Promise<boolean>), so the old truthiness check no longer compiled: error TS1345: An expression of type 'void' cannot be tested for truthiness.

-    const status = await zip.writeZipPromise(zipPath).catch(() => {
+    try {
+      await zip.writeZipPromise(zipPath);
+    } catch {
       this.log('Zipping project process failed! Please try again.');
       this.exit(1);
-    });
-
-    if (!status) {
-      this.log('Zipping project process failed! Please try again.');
-      this.exit(1);
     }

Why this preserves behavior: the type changed, the runtime contract did not — 0.6.0's implementation still resolve(done) on success and rejects on failure. Failure therefore still reaches exactly one log + exit(1), and success still falls through. The rewrite tracks failure through the .catch() (the actual signal) instead of a return value the types no longer expose. Incidentally it also removes the old double-log: the previous code logged in .catch() and again in the if (!status) branch on the same failure.

Now covered by tests. src/adapters/file-upload.test.ts gains an archive describe block with two cases: writeZipPromise rejecting (asserts the message is logged exactly once and exit(1) fires) and resolving (asserts the returned zip details, and that neither log nor exit is called). Suite is 137 passed, up from 135. Verified they fail for the right reason: injecting a swallowed-rejection regression fails the first test while the second still passes. The failure path also moved from a zipped flag to a plain try/catch on review feedback — simpler, and the tests passed unchanged across that refactor, which is itself evidence they assert behaviour rather than implementation.

Why the adm-zip major is safe here

The 0.6.0 release notes list exactly two behavior changes, both in extraction:

  1. extractEntryTo(...) now preserves subdirectories instead of flattening by basename.
  2. Extraction no longer fails when the modification time can't be set (utimes is best-effort).

This repo is write-only: the sole usage is new AdmZip() plus addLocalFolder / addLocalFile / writeZipPromise. Grepping src/ and test/ finds no extractEntryTo, extractAllTo, or getEntries call anywhere — so neither breaking change is reachable. The third note (minimum Node raised to 14) is moot: engines already requires >=22.0.0.

Full scope of this PR — .talismanrc is also changed

This PR also changes .talismanrc (secrets-scanner config). Talisman flags
src/adapters/file-upload.ts and src/adapters/file-upload.test.ts with low-severity matches on
pre-existing lines this diff never touches — it re-scans each whole file because the checksum
changed, and both prior entries were checksum-based, so editing either file invalidated them.

Both are now per-pattern allowed_patterns, so the filecontent detector stays active on both
files and only these specific lines are exempt:

File Exempted lines
file-upload.ts formFieldKey/formFieldValue destructuring + formData.append (388-389); the headers type and headers?.reduce (426, 433); the ({ key, value }) => ({ key, value })) map callback (142); const { token, apiKey } = configHandler.get (189)
file-upload.test.ts the two `--(disable

Every pattern matches an identifier or destructuring shape, never a value, so a real leaked
credential in either file would still be caught.

On fail-closed vs. pattern-based — a reviewer fairly noted allowed_patterns keeps suppressing
across future edits, whereas a checksum invalidates itself. That is the trade-off, and it cuts both
ways: the checksum form is what produced this failure in the first place, because it re-breaks on
every unrelated edit to the file (the secrets-scan failures across this whole fleet of PRs were
exactly that). The patterns here are narrow enough that genuinely new content is still scanned.
If the team prefers strict fail-closed behaviour on production source, a checksum entry is a
reasonable alternative — happy to switch.

Note .talismanrc itself now trips the detector as warnings (non-fatal) — inherent to the
per-pattern approach, since the exemptions must quote the strings they exempt.

Ecosystem-native audit pass (step 1.5)

  • npm audit: 1 high → 0. npm audit fix (non---force) correctly declined the adm-zip fix, reporting fix available via npm audit fix --force ... which is a breaking change, and left the tree untouched — --force is prohibited by this routine. The bump was therefore taken through the deliberate Snyk path above, with changelog review and the adaptation documented, rather than applied blindly.

Snyk scan

1 project scanned (package-lock.json, 463 deps), matching the one manifest on disk. 3 issues → 1 (the remaining one is unfixable — below).

Self code review

2 rounds.

  • Low (fixed): the first edit to package.json added a trailing newline the file didn't have, producing unrelated whitespace noise. Restored the original formatting so the manifest diff is exactly the intended lines.
  • Round 2 found no High or Medium issues. Lockfile churn was reviewed and is confined to the adm-zip bump, the qs resolution, and the @types/adm-zip removal.

Needs human review — NOT yet resolved

adm-zipCVE-2026-76845, Symlink Attack (high). No fix exists. The advisory range is >=0.5.9, which includes 0.6.0, so this is pre-existing — 0.5.18 was affected too and this PR neither introduces nor worsens it. The vulnerable code paths are extractAllTo, extractAllToAsync and extractEntryTo in util/utils.js; as established above, this repo never extracts archives, so the paths are unreachable here. Left for a maintainer to track until upstream ships a fix (or to ignore on the dashboard citing non-reachability).

Validation

  • npm install — pass, no errors
  • npm run build (tsc -b + patch step) — pass
  • npm test — pass (8 suites, 135 passed)
  • npm audit — 1 high → 0
  • snyk test --all-projects re-scan — the adm-zip DoS and both qs advisories are gone; only the unfixable symlink advisory remains
  • No peer-dependency warnings

dhruv-parekh-cs and others added 2 commits August 31, 2026 11:59
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 31, 2026 07:31
@dhruv-parekh-cs
dhruv-parekh-cs requested review from a team as code owners August 31, 2026 07:31
@snyk-io

snyk-io Bot commented Aug 31, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 1 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 1
  • Medium without fixes: 0
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Automated dependency-vulnerability remediation for the Node.js CLI by upgrading adm-zip (with a small TypeScript adaptation) and raising an existing qs override floor to a patched version.

Changes:

  • Bumped adm-zip to ^0.6.0 and updated archive() to handle writeZipPromise()’s void return type.
  • Raised the qs override to ^6.16.0 and updated the lockfile accordingly.
  • Removed @types/adm-zip (now bundled with adm-zip@0.6.0) and updated Talisman ignore config.
File summaries
File Description
src/adapters/file-upload.ts Adjusts ZIP creation error handling to match adm-zip@0.6.0 typings/contract.
package.json Updates dependency versions (adm-zip, qs override) and removes @types/adm-zip.
package-lock.json Locks updated adm-zip/qs resolutions and removes @types/adm-zip entries.
.talismanrc Adds a new ignore entry for src/adapters/file-upload.ts (needs reconsideration).
Review details
  • Files reviewed: 3/4 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .talismanrc Outdated
Comment thread src/adapters/file-upload.ts Outdated
Copilot AI review requested due to automatic review settings August 31, 2026 08:47
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 1 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 1
  • Medium without fixes: 0
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 4/5 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread src/adapters/file-upload.ts Outdated
Comment thread .talismanrc
Comment thread .talismanrc
Copilot AI review requested due to automatic review settings August 31, 2026 08:50
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 1 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 1
  • Medium without fixes: 0
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (2)

src/adapters/file-upload.ts:343

  • The new zipped flag + .catch() indirection makes this error path harder to follow and relies on mutable state. A simple try/catch around writeZipPromise is clearer and keeps the “single log + exit(1)” behavior without needing a sentinel boolean.
    let zipped = true;
    await zip.writeZipPromise(zipPath).catch(() => {
      zipped = false;
    });

.talismanrc:24

  • PR description says the .talismanrc change for src/adapters/file-upload.ts is a checksum entry that “fails closed”, but the diff adds allowed_patterns instead. allowed_patterns does not fail-closed (it can continue suppressing findings after future edits) and is a materially different risk profile—either update the description or switch this entry to a checksum-based ignore.
- filename: src/adapters/file-upload.ts
  allowed_patterns:
    - "const \\{ formFieldKey, formFieldValue \\} of fields"
    - "formData\\.append\\(formFieldKey, formFieldValue\\)"
  • Files reviewed: 4/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread src/adapters/file-upload.test.ts
Copilot AI review requested due to automatic review settings August 31, 2026 08:55
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 1 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 1
  • Medium without fixes: 0
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Review details
  • Files reviewed: 4/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings August 31, 2026 08:59
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 1 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 1
  • Medium without fixes: 0
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Review details
  • Files reviewed: 4/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@dhruv-parekh-cs
dhruv-parekh-cs merged commit 3bb3ff2 into development Aug 31, 2026
9 checks passed
@dhruv-parekh-cs
dhruv-parekh-cs deleted the CL-snyk-fixes/31-Aug-2026 branch August 31, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants