Skip to content

Resolve vulnerable on-headers transitively via workspace morgan override#2018

Draft
mikeharder with Copilot wants to merge 2 commits into
mainfrom
copilot/ghsa-76c9-3jph-rj3q-fix-on-headers-vulnerability
Draft

Resolve vulnerable on-headers transitively via workspace morgan override#2018
mikeharder with Copilot wants to merge 2 commits into
mainfrom
copilot/ghsa-76c9-3jph-rj3q-fix-on-headers-vulnerability

Conversation

Copilot AI commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Dependabot flagged on-headers@1.0.2 in pnpm-lock.yaml (GHSA-76c9-3jph-rj3q / CVE-2025-7339). The vulnerable package was present transitively through the test server dependency graph and is now resolved to a non-vulnerable version.

  • What changed

    • Moved pnpm overrides to pnpm-workspace.yaml, which is the config location honored by the current pnpm workspace setup.
    • Added a workspace override for morgan@1.10.1, which pulls in on-headers@1.1.0.
    • Regenerated pnpm-lock.yaml so the vulnerable on-headers@1.0.2 resolution is removed.
  • Why this shape

    • A direct bump of @microsoft.azure/autorest.testserver was attempted first, but the published package metadata was not resolvable by pnpm in this workspace.
    • Overriding morgan was the smallest working change that cleanly removed the vulnerable transitive resolution.
  • Reachability Assessment

    • Affected API: response.writeHead() when passed an array.
    • Dependency path: packages/autorest.go devDependency @microsoft.azure/autorest.testserver -> morgan -> on-headers.
    • Repository usage: no first-party writeHead(...) call sites were found, and no first-party morgan usage was found.
    • Conclusion: the advisory-specific code path does not appear reachable from repository-owned source; this change primarily removes a vulnerable transitive dependency from the workspace graph.
    • Confidence: High.
  • Configuration snippet

    overrides:
      morgan: 1.10.1
  • Pre-existing unrelated failure

    • Repository-wide tests still hit the existing packages/autorest.gotest environment issue: goimports: not found.
Original prompt

This section details the Dependabot vulnerability alert you should resolve

<alert_title>on-headers is vulnerable to http response header manipulation</alert_title>
<alert_description>### Impact

A bug in on-headers versions < 1.1.0 may result in response headers being inadvertently modified when an array is passed to response.writeHead()

Patches

Users should upgrade to 1.1.0

Workarounds

Uses are encouraged to upgrade to 1.1.0, but this issue can be worked around by passing an object to response.writeHead() rather than an array.</alert_description>

low
GHSA-76c9-3jph-rj3q, CVE-2025-7339
on-headers
npm
<vulnerable_versions>1.0.2</vulnerable_versions>
<patched_version>1.1.0</patched_version>
<manifest_path>pnpm-lock.yaml</manifest_path>

https://github.com/jshttp/on-headers/security/advisories/GHSA-76c9-3jph-rj3q https://nvd.nist.gov/vuln/detail/CVE-2025-7339 https://github.com/expressjs/morgan/issues/315 https://github.com/jshttp/on-headers/issues/15 https://github.com/jshttp/on-headers/commit/c6e384908c9c6127d18831d16ab0bd96e1231867 https://cna.openjsf.org/security-advisories.html https://github.com/advisories/GHSA-76c9-3jph-rj3q

<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>

Copilot AI changed the title [WIP] Update on-headers to version 1.1.0 to fix vulnerability Resolve vulnerable on-headers transitively via workspace morgan override Jun 24, 2026
Copilot AI requested a review from mikeharder June 24, 2026 05:57
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.

2 participants