ipv6 validation does not allow all ipv6 variantions #651

Closed
opened 2026-04-05 17:31:20 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @LaurenceJJones on 11/11/2025

d38b321f85/server/lib/validators.ts (L88)

The regex here is expecting a full 8-hextet IPv6 only. It wont allow these other variants of ipv6:

::1 (loopback, compressed)
2001:db8::1 (compressed zeros)
fe80::1%eth0 (zone ID)
::ffff:192.0.2.128 (IPv4-mapped)

Either we should expand the regex to handle all cases or switch over to ipaddr.js library for a more "battle tested" library but up to you!

*Originally created by @LaurenceJJones on 11/11/2025* https://github.com/fosrl/pangolin/blob/d38b321f85ffdf7fc2ea22ed0f4d518d3baed12c/server/lib/validators.ts#L88 The regex here is expecting a full 8-hextet IPv6 only. It wont allow these other variants of ipv6: ``` ::1 (loopback, compressed) 2001:db8::1 (compressed zeros) fe80::1%eth0 (zone ID) ::ffff:192.0.2.128 (IPv4-mapped) ``` Either we should expand the regex to handle all cases or switch over to ipaddr.js library for a more "battle tested" library but up to you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/pangolin#651