Skip to content

webchat: patch transitive node-fetch vulnerability (GHSA-r683-j2x4-v87g) - #4455

Merged
stephenhand merged 2 commits into
masterfrom
copilot/fix-node-fetch-vulnerability
Jun 5, 2026
Merged

stephenhand merged 2 commits into
masterfrom
copilot/fix-node-fetch-vulnerability

Conversation

Copilot AI commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

Dependabot flagged node-fetch@1.7.3 in webchat/package-lock.json for forwarding sensitive headers across untrusted redirects (GHSA-r683-j2x4-v87g / CVE-2022-0235). This PR pins the affected transitive path to the lowest patched version (2.6.7) with a minimal, scoped dependency change.

  • Dependency remediation

    • Added an npm overrides entry in webchat/package.json to force isomorphic-fetch -> node-fetch@2.6.7.
    • Regenerated webchat/package-lock.json via npm tooling to remove the vulnerable resolution.
  • Reachability assessment

    • The vulnerable package is transitive (isomorphic-fetch via fbjs) and not directly imported in webchat source.
    • Webchat code uses browser fetch callsites (e.g. IP lookup, operating hours, end chat, recaptcha) and does not set advisory-listed sensitive headers (authorization, cookie, etc.) in these paths.
    • Assessment: not clearly runtime-reachable in current app code; update is primarily scanner-driven hardening. Confidence: high.
"overrides": {
  "@twilio/flex-webchat-ui": {
    "twilio-chat": {
      "rfc6902": "5.0.1"
    }
  },
  "isomorphic-fetch": {
    "node-fetch": "2.6.7"
  }
}

Checklist

  • Corresponding issue has been opened
  • New tests added
  • Feature flags added
  • Strings are localized
  • Tested for chat contacts
  • Tested for call contacts

Other Related Issues

None

Verification steps

  • From /webchat, run:
    • npm install
    • npm ls node-fetch
  • Confirm output shows:
    • isomorphic-fetch -> node-fetch@2.6.7
    • no node-fetch@1.7.3 in the dependency tree
  • Confirm webchat/package-lock.json resolves node_modules/node-fetch to 2.6.7.

AFTER YOU MERGE

  1. Cut a release tag using the Github workflow. Wait for it to complete and notify in the #aselo-deploys Slack channel.
  2. Comment on the ticket with the release tag version AND any additional instructions required to configure an environment to test the changes.
  3. Only then move the ticket into the QA column in JIRA

You are responsible for ensuring the above steps are completed. If you move a ticket into QA without advising what version to test, the QA team will assume the latest tag has the changes. If it does not, the following confusion is on you! :-P

Original prompt

This section details the Dependabot vulnerability alert you should resolve

<alert_title>node-fetch forwards secure headers to untrusted sites</alert_title>
<alert_description>node-fetch forwards secure headers such as authorization, www-authenticate, cookie, & cookie2 when redirecting to a untrusted site.</alert_description>

high
GHSA-r683-j2x4-v87g, CVE-2022-0235
node-fetch
npm
<vulnerable_versions>1.7.3</vulnerable_versions>
<patched_version>2.6.7</patched_version>
<manifest_path>webchat/package-lock.json</manifest_path>

https://nvd.nist.gov/vuln/detail/CVE-2022-0235 https://github.com/node-fetch/node-fetch/commit/36e47e8a6406185921e4985dcbeff140d73eaa10 https://huntr.dev/bounties/d26ab655-38d6-48b3-be15-f9ad6b6ae6f7 https://github.com/node-fetch/node-fetch/pull/1453 https://github.com/node-fetch/node-fetch/commit/5c32f002fdd65b1c6a8f1e3620210813d45c7e60 https://cert-portal.siemens.com/productcert/pdf/ssa-637483.pdf https://lists.debian.org/debian-lts-announce/2022/12/msg00007.html https://github.com/node-fetch/node-fetch/pull/1449/commits/5c32f002fdd65b1c6a8f1e3620210813d45c7e60 https://github.com/node-fetch/node-fetch/commit/1ef4b560a17e644a02a3bfdea7631ffeee578b35 https://github.com/advisories/GHSA-r683-j2x4-v87g

<task_instructions>Resolve this alert by updating the affected package to a non-vulnerable version. Prefer the lowest non-vulnerable version (see the patched_version field above) over the latest to minimize breaking changes. Include a Reachability Assessment section in the PR description. Review the alert_description field to understand which APIs, features, or configurations are affected, then search the codebase for usage of those specific items. If the vulnerable code path is reachable, explain how (which files, APIs, or call sites use the affected functionality) and note that the codebase is actively exposed to this vulnerability. If the vulnerable code path is not reachable, explain why (e.g. the affected API is never called, the vulnerable configuration is not used) and note that the update is primarily to satisfy vulnerability scanners rather than to address an active risk. If the advisory is too vague to determine reachability (e.g. 'improper input validation' with no specific API named), state that reachability could not be determined and explain why. Include a confidence level in the reachability assessment (e.g. high confidence if the advisory names a specific API and you confirmed it is or is not called, low confidence if the usage is indirect and hard to trace). If no patched version is available, check the alert_description field for a Workarounds section — the advisory may describe configuration changes or usage patterns that mitigate the vulnerability without a version update. If a workaround is available, apply it and leave a code comment referencing the advisory identifier explaining it is a temporary mitigation. If neither a patch nor a workaround is available, explain in the PR description why the alert cannot be resolved automatically so a human reviewer can take over. Inspect the repository to determine which package manager is used (e.g. lock files, config files, build scripts) and use that tooling to perform the update — do not edit lock files directly. If the version constraint in the manifest (e.g. package.json, Gemfile, pyproject.toml) caps the version below the fix, update the constraint first. For transitive dependencies, determine whether it is simpler to update the direct dependency that pulls in the vulnerable package or to update the transitive dependency directly, and choose the least disruptive approach. If upgrading to fix the vulnerability forces a major version bump or known breaking changes, review the changelog or release notes, then audit the codebase for usage of affected APIs and fix any breaking changes that are found. If the package manager fails to resolve dependencies (e.g. peer dependency conflicts, incompatible engine constraints), document the error in the PR description rather than attempting increasingly complex workarounds. After updating, check the lock file to confirm the package no longer resolves to a version in the vulnerable range. Keep changes minimal and tightly scoped. Ensure tests, build, type checking, and linting all pass after your changes. If there are any test, lint, or typechecking failures, investigate whether they are caused by the update and fix them if so — do not leave broken tests in the PR. If they were already present before the update, note them in the PR description so a human reviewer can assess whether they are related.</task_instructions>

Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix node-fetch vulnerability in webchat package webchat: patch transitive node-fetch vulnerability (GHSA-r683-j2x4-v87g) Jun 4, 2026
Copilot AI requested a review from stephenhand June 4, 2026 14:40
@stephenhand
stephenhand marked this pull request as ready for review June 5, 2026 11:04
Copilot AI review requested due to automatic review settings June 5, 2026 11:04
@stephenhand
stephenhand merged commit 88d780e into master Jun 5, 2026
26 checks passed
@stephenhand
stephenhand deleted the copilot/fix-node-fetch-vulnerability branch June 5, 2026 11:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a Dependabot security alert in the legacy webchat/ project by ensuring the vulnerable transitive node-fetch@1.7.3 resolution is replaced with a patched node-fetch version, while keeping the dependency change tightly scoped.

Changes:

  • Added an npm overrides rule in webchat/package.json to force the isomorphic-fetch -> node-fetch resolution to 2.6.7.
  • Regenerated webchat/package-lock.json so the installed node-fetch resolves to 2.6.7 (and no node-fetch@1.7.3 remains in the lockfile).

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
webchat/package.json Adds an overrides entry to pin the vulnerable transitive dependency path to node-fetch@2.6.7.
webchat/package-lock.json Updates the resolved dependency graph to remove node-fetch@1.7.3 and lock node-fetch to patched versions.
Files not reviewed (1)
  • webchat/package-lock.json: Language not supported

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