Skip to content

Reject signed hex group in InetAddressValidator.isValidInet6Address(String)#379

Merged
garydgregory merged 1 commit into
apache:masterfrom
sahvx655-wq:ipv6-reject-signed-group
May 30, 2026
Merged

Reject signed hex group in InetAddressValidator.isValidInet6Address(String)#379
garydgregory merged 1 commit into
apache:masterfrom
sahvx655-wq:ipv6-reject-signed-group

Conversation

@sahvx655-wq
Copy link
Copy Markdown
Contributor

isValidInet6Address parses each hex group with Integer.parseInt(octet, 16), which tolerates a leading '+', so addresses like 1:2:3:4:5:6:7:+8, fe80::+1 and ::+f are accepted even though they are not valid IPv6 literals (JDK InetAddress.getByName rejects them); the '-' form is already caught by the existing octetInt < 0 check, so only '+' slips through.

@garydgregory garydgregory merged commit 0c7db82 into apache:master May 30, 2026
9 checks passed
@garydgregory garydgregory changed the title reject signed hex group in isValidInet6Address Reject signed hex group in isValidInet6Address May 30, 2026
@garydgregory garydgregory changed the title Reject signed hex group in isValidInet6Address Reject signed hex group in InetAddressValidator.isValidInet6Address(String) May 30, 2026
@garydgregory
Copy link
Copy Markdown
Member

@sahvx655-wq

Thank you for the PR. I merged the PR and followed up with a clean up to remove an unnecessary duplicate call.

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.

2 participants