Skip to content

fix(socks): handle IPv4-mapped IPv6 addresses in ipToSocksAddress#41110

Merged
yury-s merged 1 commit into
microsoft:mainfrom
yury-s:fix-41107
Jun 2, 2026
Merged

fix(socks): handle IPv4-mapped IPv6 addresses in ipToSocksAddress#41110
yury-s merged 1 commit into
microsoft:mainfrom
yury-s:fix-41107

Conversation

@yury-s

@yury-s yury-s commented Jun 2, 2026

Copy link
Copy Markdown
Member

Summary

  • socket.localAddress returns IPv4-mapped IPv6 addresses (e.g. ::ffff:10.0.0.1) on dual-stack systems, which fail net.isIPv4() and fell into the IPv6 branch of ipToSocksAddress, producing a malformed SOCKS address.
  • Unwrap the ::ffff: prefix to a plain IPv4 dotted-quad before the isIPv4 check.

Fixes #41107

On dual-stack systems Node.js returns IPv4-mapped IPv6 addresses (e.g.
"::ffff:10.0.0.1") from socket.localAddress. These fail net.isIPv4() and
fell into the IPv6 branch, producing a malformed SOCKS address. Unwrap the
::ffff: prefix to a plain IPv4 dotted-quad before the isIPv4 check.

Fixes: microsoft#41107
@yury-s yury-s requested a review from dgozman June 2, 2026 22:18
@yury-s yury-s merged commit dfee7ac into microsoft:main Jun 2, 2026
43 of 44 checks passed
@yury-s yury-s deleted the fix-41107 branch June 2, 2026 22:46
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [chrome] › mcp/annotate.spec.ts:57 › should capture multiple screenshots in one annotation @mcp-ubuntu-latest-chrome

7229 passed, 1103 skipped


Merge workflow run.

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

1 flaky ⚠️ [chromium-library] › library/video.spec.ts:682 › screencast › should capture full viewport on hidpi `@chromium-ubuntu-22.04-node20`

39528 passed, 775 skipped


Merge workflow run.

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.

ipToSocksAddress does not handle IPv6-mapped IPv4 addresses (::ffff:x.x.x.x)

2 participants