Skip to content

Bump fast-uri to 3.1.2 to fix path traversal (GHSA-q3j6-qgpj-74h6)#15908

Merged
mikeharder merged 5 commits into
mainfrom
copilot/upgrade-fast-uri-to-311
Jun 5, 2026
Merged

Bump fast-uri to 3.1.2 to fix path traversal (GHSA-q3j6-qgpj-74h6)#15908
mikeharder merged 5 commits into
mainfrom
copilot/upgrade-fast-uri-to-311

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 4, 2026

Resolves the Dependabot alert for fast-uri path traversal via percent-encoded dot segments (GHSA-q3j6-qgpj-74h6 / CVE-2026-6321), which let distinct URIs collapse onto the same normalized path in normalize()/equal(). fast-uri was a transitive dependency of eng/common/tsp-client resolving to the vulnerable 3.1.0.

Changes

  • package-lock.json: fast-uri bumped directly from 3.1.0 to 3.1.2 (no package.json changes).

Version choice

The alert's patched version is 3.1.1, but fast-uri <=3.1.1 is also flagged by a separate advisory (GHSA-v39h-62p7-jpjc). 3.1.2 is the lowest version free of all known advisories. npm audit reports 0 vulnerabilities.

Reachability assessment

High confidence the update is low-risk and not an actively-exploited path. fast-uri is transitive only (via ajv@typespec/compiler@azure-tools/typespec-client-generator-cli), used for JSON-schema validation. The repo never calls fast-uri's normalize()/equal() nor performs attacker-controlled URL normalization or path-based policy enforcement, so the vulnerable path is not reachable. The bump primarily satisfies scanners.

Original prompt

This section details the Dependabot vulnerability alert you should resolve

<alert_title>fast-uri vulnerable to path traversal via percent-encoded dot segments</alert_title>
<alert_description>### Impact

fast-uri v3.1.0 and earlier decodes percent-encoded path separators (%2F) and dot segments (%2E) before applying dot-segment removal in normalize() and equal(). This makes encoded path data behave like real / and .., so distinct URIs collapse onto the same normalized path.

For example, http://example.com/public/%2e%2e/admin normalizes to http://example.com/admin, and equal() considers them the same URI.

Applications that normalize or compare attacker-controlled URLs to enforce path-based policy can be bypassed. A path that looks confined under an allowed prefix can normalize to a different location.

Patches

Upgrade to fast-uri >= 3.1.1.

Workarounds

None. Upgrade to the patched version.</alert_description>

high
GHSA-q3j6-qgpj-74h6, CVE-2026-6321
fast-uri
npm
<vulnerable_versions>3.1.0</vulnerable_versions>
<patched_version>3.1.1</patched_version>
<manifest_path>eng/common/tsp-client/package-lock.json</manifest_path>

https://github.com/fastify/fast-uri/security/advisories/GHSA-q3j6-qgpj-74h6 https://nvd.nist.gov/vuln/detail/CVE-2026-6321 https://cna.openjsf.org/security-advisories.html https://github.com/advisories/GHSA-q3j6-qgpj-74h6

<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: mikeharder <9459391+mikeharder@users.noreply.github.com>
Copilot AI changed the title [WIP] Update fast-uri to version 3.1.1 to resolve vulnerability Bump fast-uri to 3.1.2 to fix path traversal (GHSA-q3j6-qgpj-74h6) Jun 4, 2026
Copilot AI requested a review from mikeharder June 4, 2026 06:00
Comment thread eng/common/tsp-client/package.json Outdated
"dependencies": {
"@azure-tools/typespec-client-generator-cli": "0.32.1"
},
"overrides": {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@copilot: can we revert the override and just bump in package-lock.json?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 682fcaa — reverted the package.json override; fast-uri is now bumped directly in package-lock.json (3.1.0 → 3.1.2). npm audit reports 0 vulnerabilities.

…json

Co-authored-by: mikeharder <9459391+mikeharder@users.noreply.github.com>
Copilot AI requested a review from mikeharder June 4, 2026 06:26
@mikeharder mikeharder marked this pull request as ready for review June 4, 2026 06:29
@mikeharder mikeharder requested a review from danieljurek as a code owner June 4, 2026 06:29
Copilot AI review requested due to automatic review settings June 4, 2026 06:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Files not reviewed (1)
  • eng/common/tsp-client/package-lock.json: Language not supported

@azure-sdk-automation
Copy link
Copy Markdown
Contributor

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

Copy link
Copy Markdown
Member

@mikeharder mikeharder left a comment

Choose a reason for hiding this comment

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

blocking for eng/common update

azure-sdk-automation Bot added a commit to Azure/azure-sdk-for-js that referenced this pull request Jun 5, 2026
Sync eng/common directory with azure-sdk-tools for PR
Azure/azure-sdk-tools#15908 See [eng/common
workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow)

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mikeharder <9459391+mikeharder@users.noreply.github.com>
azure-sdk-automation Bot added a commit to Azure/azure-sdk-for-rust that referenced this pull request Jun 5, 2026
Sync eng/common directory with azure-sdk-tools for PR
Azure/azure-sdk-tools#15908 See [eng/common
workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow)

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mikeharder <9459391+mikeharder@users.noreply.github.com>
@mikeharder mikeharder merged commit e020912 into main Jun 5, 2026
6 of 7 checks passed
@mikeharder mikeharder deleted the copilot/upgrade-fast-uri-to-311 branch June 5, 2026 16:07
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