Skip to content

build(deps): Pin decode-uri-component to patched 0.5.1 to resolve DoS advisory - #6975

Closed
antonis wants to merge 1 commit into
mainfrom
chore/override-decode-uri-component
Closed

antonis wants to merge 1 commit into
mainfrom
chore/override-decode-uri-component

Conversation

@antonis

@antonis antonis commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Adds a resolutions override pinning decode-uri-component to the patched 0.5.1 to clear a quadratic-time DoS advisory.

query-string@7.1.3 pins decode-uri-component@^0.2.2, so Dependabot refuses to update it (0.5.1 is outside that range). A yarn resolutions override bypasses the range, and it is a safe drop-in: the package has zero dependencies and the same single-function API across 0.2 → 0.5 — only the internal decoder was rewritten.

Package Before → After Advisory Alert
decode-uri-component 0.2.2 → 0.5.1 Quadratic-time DoS via percent-encoded runs on malformed input #723 (high)

💡 Motivation and Context

Resolves one open Dependabot alert that Dependabot itself cannot auto-fix. decode-uri-component is a transitive sample-app dependency (query-string ← @react-navigation/core, used by the RN and macOS sample apps) — not a dependency of the shipped @sentry/react-native package (packages/core), so nothing reaches end-user apps.

💚 How did you test it?

Added "decode-uri-component": "^0.5.1" to root resolutions, ran yarn install (resolves to 0.5.1), and verified only package.json and yarn.lock changed.

📝 Checklist

  • I added tests to verify changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • No breaking changes.

🔮 Next steps

Remove the decode-uri-component resolutions override once query-string (via @react-navigation) widens its range to a patched release.

🤖 Generated with Claude Code

… advisory

query-string@7.1.3 pins decode-uri-component to ^0.2.2, so Dependabot
cannot update it to the fixed 0.5.1 without violating that range. Add a
resolutions override forcing 0.5.1, which is a safe drop-in: the package
has zero dependencies and the same single-function API across 0.2 -> 0.5
(only the internal decoder changed).

- decode-uri-component: 0.2.2 -> 0.5.1 (quadratic-time DoS on malformed
  percent-encoded input) [#723]

Transitive sample-app dependency (query-string via @react-navigation);
not shipped in @sentry/react-native.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

⚪ None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • build(deps): Pin decode-uri-component to patched 0.5.1 to resolve DoS advisory by antonis and claude in #6975
  • fix(android): Restore enableLogs option mapping by antonis and claude in #6967
  • chore(deps): update Wizard to v9.1.0 by github-actions in #6972
  • chore(deps): update Sentry Android Gradle Plugin to v6.25.0 by github-actions in #6971

🤖 This preview updates automatically when you update the PR.

@github-actions

Copy link
Copy Markdown
Contributor
Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request

Generated by 🚫 dangerJS against 467b314

@antonis
antonis marked this pull request as ready for review October 30, 2026 07:41
@antonis
antonis requested review from a team and lucas-zimerman as code owners October 30, 2026 07:41
@antonis
antonis requested review from alwx and buenaflor and removed request for a team October 30, 2026 07:41

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 467b314. Configure here.

Comment thread package.json
"glob@npm:^10.4.2": "^10.5.0",
"axios": "^1.20.0",
"follow-redirects": "^1.16.1",
"decode-uri-component": "^0.5.1",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ESM override breaks query-string

High Severity

The decode-uri-component resolution jumps to 0.5.1, but that release is ESM-only with a default export. query-string@7.1.3 still requires a CommonJS callable, so the override yields a module namespace and TypeError: decodeComponent is not a function when React Navigation or expo-router parse query strings in the sample apps.

Additional Locations (1)
Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 467b314. Configure here.

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.

Good catch — confirmed. decode-uri-component went ESM-only in 0.4.0, and query-string@7.1.3 loads it via a CommonJS require(), so forcing 0.5.1 yields a non-callable module namespace and decodeComponent is not a function when the sample apps parse query strings.

There's no CJS-compatible patched release — 0.2.2 is the last CommonJS version, and every fixed release (0.4+/0.5) is ESM-only. Since this is sample-app-only (query-string ← @react-navigation), DoS-only, and not part of the shipped @sentry/react-native, we're dismissing the Dependabot alert as tolerable risk and closing this PR rather than shipping a broken override.

@antonis antonis closed this Oct 30, 2026
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.

1 participant