Project

General

Profile

Actions

Bug #19479

closed

Support IPv4-mapped IPv6 addresses in IPAddr#private?

Added by tgxworld (Guo Xiang Tan) about 1 year ago. Updated 11 months ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.2.1 (2023-02-08 revision 31819e82c8) [x86_64-linux]
[ruby-core:112697]

Description

irb(main):010:0> IPAddr.new("172.16.0.0").private?
=> true
irb(main):011:0> IPAddr.new("::ffff:172.16.0.0").private?
=> false

If IPAddr#private? is used in a critical code path, not supporting IPv4-mapped IPv6 addresses could lead to security issues.

Actions

Also available in: Atom PDF

Like0
Like0Like0