Skip to content

test(format/uri): assert IPv6 and IPvFuture host formatting constraints#957

Open
AcEKaycgR wants to merge 1 commit into
json-schema-org:mainfrom
AcEKaycgR:uri-ip-address-constraints
Open

test(format/uri): assert IPv6 and IPvFuture host formatting constraints#957
AcEKaycgR wants to merge 1 commit into
json-schema-org:mainfrom
AcEKaycgR:uri-ip-address-constraints

Conversation

@AcEKaycgR

Copy link
Copy Markdown
Contributor

Applies to: draft-v1, draft-04, draft-06, draft-07, draft/2019-09, draft/2020-12

Adds 20 new cases asserting strict syntax constraints on IPv6 and IPvFuture host formats, including square bracket requirements, and Cyrillic/non-ASCII host rejections.

Added:

  • Unbracketed IPv6 host (invalid)
  • Invalid hex digit in IPv6 brackets (invalid)
  • Empty brackets [] host (invalid)
  • Brackets in query (invalid)
  • Brackets in fragment (invalid)
  • Brackets in path (invalid)
  • IPv6 with multiple double-colons (invalid)
  • IPv6 with 7 groups and no double-colon (invalid)
  • IPv6 with 9 groups (invalid)
  • IPv6 group with >4 hex digits (invalid)
  • IPv6 with out-of-bounds embedded IPv4 octet (invalid)
  • Valid IPv6 with embedded IPv4 (valid)
  • IPvFuture missing version (invalid)
  • IPvFuture missing dot (invalid)
  • IPvFuture empty content after dot (invalid)
  • IPvFuture with non-hex version (invalid)
  • Valid IPvFuture host (valid)
  • IPvFuture with uppercase V version (valid)
  • Non-ASCII Cyrillic host (invalid)
  • Non-ASCII Latin host (invalid)

Ecosystem Impact (Triangulation):

Under Bowtie verification against 8 active implementations, these cases successfully caught live compliance issues:

  1. Go Bug Caught: go-gojsonschema incorrectly accepts unbracketed IPv6, empty brackets, brackets in path/query/fragment, and malformed IPv6/IPvFuture hosts.
  2. Go Bug Caught: go-gojsonschema incorrectly accepts Cyrillic and non-ASCII Latin characters in host names.
  3. PHP Bug Caught: php-opis-json-schema incorrectly rejects valid IPv6 with embedded IPv4 ("http://[::ffff:192.168.1.1]"), valid IPvFuture hosts, and uppercase V versions.
  4. PHP Bug Caught: php-opis-json-schema incorrectly accepts brackets in query/fragment.

@jviotti @jdesrosiers @karenetheridge Ready for review.

@AcEKaycgR AcEKaycgR requested a review from a team as a code owner June 27, 2026 06:34
@AcEKaycgR AcEKaycgR force-pushed the uri-ip-address-constraints branch from 83f1ffe to 37c7ad7 Compare June 27, 2026 06:37
@AcEKaycgR AcEKaycgR force-pushed the uri-ip-address-constraints branch from 37c7ad7 to 6918888 Compare June 27, 2026 06:39

@jviotti jviotti left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. Looks all correct as far as I can tell and I appreciate the evidence on the ones that break!

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