Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: beaugunderson/ip-address
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v10.4.0
Choose a base ref
...
head repository: beaugunderson/ip-address
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v10.5.0
Choose a head ref
  • 3 commits
  • 10 files changed
  • 1 contributor

Commits on Aug 10, 2026

  1. Honor the fromURL graceful-failure contract for non-IPv6 hosts (#218)

    Address6.fromURL() is documented and typed to return
    `{ error, address: null, port: null }` when a URL can't be parsed, but
    that contract was only implemented on the regex-miss path. The URL host
    character class `[0-9a-f:.]` is a superset of valid IPv6, so any host
    made only of hex digits, colons and dots matched the regex and was
    handed straight to `new Address6(host)`, whose AddressError propagated
    out uncaught.
    
    IPv4 literals are the visible case — `http://127.0.0.1/`,
    `http://169.254.169.254/`, `http://0.0.0.0/` all threw — but so did
    `[:::]`, `[1:2:3:4:5:6:7:8:9]` and `[::ffff:999.1.1.1]`. A plain
    hostname like `example.com` avoided the throw only because letters
    outside a-f break the regex match first.
    
    Catch the constructor and return the same error object the regex-miss
    path returns, so the function never throws for any input.
    
    Reported by @zikk090 via GHSA-mxvh-v779-f36j. Declining that as a
    security advisory: an uncaught synchronous throw from a parser on the
    caller's own stack is a correctness bug, not a denial of service.
    beaugunderson authored Aug 10, 2026
    Configuration menu
    Copy the full SHA
    d478737 View commit details
    Browse the repository at this point in the history
  2. Correct the documentation where it disagreed with the library (#219)

    An audit of every documented claim against the built library. All 40
    worked examples (18 in the README block, 22 JSDoc @example) already
    passed; the inaccuracies were in prose and in generated signatures.
    
    Generated signatures (scripts/build-readme.ts):
    
    - Six signatures declared required parameters that carry defaults, two
      of them contradicting their own prose in the same bullet ("The default
      prefix is the well-known prefix 64:ff9b::/96" beside a signature
      saying you must pass it). TypeDoc sets isOptional inconsistently for
      defaulted parameters, so treat a default as optional too.
    - TypeScript `this` annotations rendered as arguments, so
      `isInSubnet(address)` read as taking two. Filter them out, and route
      function-valued properties through the same parameter rules.
    
    Prose:
    
    - Address4.reverseForm() was documented as returning ip6.arpa form. It
      returns in-addr.arpa, as the @PARAM two lines below already said.
    - 6to4 embeds a 32-bit IPv4 address in bits 16-47, not "the second 16
      bits".
    - "Parses all standard IPv4 and IPv6 notations" claimed more than the
      library does: the inet_aton forms are rejected by design, which
      SECURITY.md already says.
    - group() and groupForV6() return HTML and said nothing about it. These
      are the surfaces GHSA-v2v4-37r5-5v8g was about.
    - AddressError.parseMessage had no description at all, though
      GHSA-v2v4-37r5-5v8g describes rendering it as HTML as "its documented
      purpose".
    - Address4's byte-array methods documented neither their throw
      conditions nor that they reject the signed bytes Address6 folds. The
      11.0.0 tripwire in test/common-test.ts owns settling that split; this
      only writes down where it stands.
    - isHostInSubnet pointed at {@link common.isHostInSubnet}, a module the
      reference doesn't cover. Inlined instead.
    - Weekly download figures were stale (~66M against 85.7M actual).
    
    Badges and source links now use main, which is the default branch, so
    they no longer lean on GitHub's renamed-branch redirect.
    
    test/readme-test.ts guards the generator fix: no signature may expose a
    `this` parameter, defaulted parameters must render optional, and the
    HTML-returning methods must say so. All three fail against the previous
    README.
    beaugunderson authored Aug 10, 2026
    Configuration menu
    Copy the full SHA
    9fd1110 View commit details
    Browse the repository at this point in the history
  3. 10.5.0

    beaugunderson committed Aug 10, 2026
    Configuration menu
    Copy the full SHA
    ef98e0a View commit details
    Browse the repository at this point in the history
Loading