deps: resolve ip-address GHSA-v2v4-37r5-5v8g via scoped overrides#3695
Merged
Conversation
Adds scoped npm overrides pinning the intermediate parents of ip-address — socks ^2.8.8 and express-rate-limit ^8.5.1 — both of which depend on patched ip-address (^10.1.1 / ^10.2.0). Pinning the parents (rather than ip-address directly) leaves @heroku/socksv5@0.0.9 on its existing ip-address@5.x; socksv5 calls the v5 API (addr.valid, addr.parsedAddress) and is not back-compatible with ip-address v10. The advisory's vulnerable surfaces (Address6.group/.link/spanAll/ parseMessage) are HTML-emitting methods. The Heroku CLI has no DOM/HTML sink, and socksv5 only consumes parsedAddress, so the remaining ip-address@5.9.4 install has no exploit path. - Resolves ip-address XSS in Address6 HTML methods (GHSA-v2v4-37r5-5v8g, MEDIUM) Closes Dependabot alerts: #309
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two scoped
npmoverrides —socks: ^2.8.8andexpress-rate-limit: ^8.5.1— to pull patchedip-address(≥ 10.1.1) into every chain that's API-compatible with v10. The remainingip-address@5.9.4install under@heroku/socksv5@0.0.9is intentionally retained because socksv5 calls the v5 API (addr.valid,addr.parsedAddress) and is not compatible with ip-address v10.After this change,
npm ls ip-address --all:Advisory closed
ip-addressXSS inAddress6.group(),link(),spanAll(), andAddressError.parseMessage, MEDIUM CVSSv4 5.3)Why scoped overrides instead of a top-level
ip-addresspinA top-level
"ip-address": "^10.1.1"override would also rewrite the version inside@heroku/socksv5@0.0.9. socksv5 callsnew Address6(str)and readsaddr.valid/addr.parsedAddress. In ip-address v10 the constructor throws on invalid input rather than settingaddr.valid, and thevalidinstance property no longer exists. Forcing v10 here would break SOCKS5 IPv6 parsing. Pinning the parents (socks,express-rate-limit) avoids this and keeps socksv5's v5 install intact.Note on residual
ip-address@5.9.4exposureThe advisory's vulnerable surfaces are HTML-emitting methods (
Address6.group(),Address6.link(),v6.helpers.spanAll(),AddressError.parseMessage) that produce HTML for browser rendering. The Heroku CLI is a Node.js command-line tool with no DOM, no HTML sink, and noinnerHTMLpath. The advisory itself notes "real-world exposure is believed to be extremely limited — analysis of all 425 dependent npm packages and GitHub code search found zero consumers ofgroup(),link(), orspanAll()."@heroku/socksv5only consumesparsedAddressand never invokes any of the vulnerable methods, so the remaining5.9.4install has no realistic exploit path.Interaction with #3694
The bundled
npm@10.9.6chain inside@oclif/plugin-plugins@5.4.58reachessocks@2.8.7 → ip-address@10.1.0via npm's vendored bundle, which doesn't honor the parent project's overrides. PR #3694 (bumping@oclif/plugin-pluginsto ^5.4.64) replaces that withnpm@11.x, which has a refreshed bundle. Either PR independently leaves the alert closeable; together they close it cleanly.Test plan
npm installcleannpm ls ip-address --allshows patched 10.x viasocksandexpress-rate-limitoverridesnpm run buildsucceedsnpm run lintsucceeds (0 errors)npm testpasses (1955 passing)@heroku/socksv5(regression check that retaining ip-address@5.9.4 there is fine)