Skip to content

fix: bound ipns caching and validate lifetimes#11349

Open
lidel wants to merge 2 commits into
masterfrom
bump-boxo-ipns-cache-control
Open

fix: bound ipns caching and validate lifetimes#11349
lidel wants to merge 2 commits into
masterfrom
bump-boxo-ipns-cache-control

Conversation

@lidel
Copy link
Copy Markdown
Member

@lidel lidel commented Jun 5, 2026

Problem

IPNS responses could be reused past a record's validity, and ipfs name publish accepted self-defeating settings. A cache (CDN, browser, Helia) could serve a record whose signature had already expired, which validating clients reject as sporadic 500s; ipfs name publish took a non-positive --lifetime, a negative --ttl, or a --ttl longer than --lifetime; and a republisher with Ipns.RecordLifetime shorter than Ipns.RepublishPeriod let records expire before the next cycle, leaving names unresolvable.

Fix

  • Bump github.com/ipfs/boxo to fix: bound ipns cache-control to record eol boxo#1166: IPNS max-age/TTL is capped to the record's remaining EOL validity across the gateway, routing/v1, and namesys (resolver + cache).
  • ipfs name publish rejects a non-positive --lifetime and a negative --ttl; an explicit --ttl over --lifetime is rejected, while an omitted --ttl is capped to --lifetime.
  • The daemon refuses to start when Ipns.RecordLifetime < Ipns.RepublishPeriod.

No cache reuses an IPNS response past the record's EOL, and ipfs name publish can no longer mint a record with an invalid lifetime or a TTL that outlives it.

TODO

Bumps github.com/ipfs/boxo to the tip of fix/ipns-cache-control-expiry
(55fd621d1872) to exercise the IPNS cache-control/TTL/EOL fixes from
ipfs/boxo#1166. Root, docs/examples, and test/dependencies modules
tidied via make mod_tidy.

Signed-off-by: Marcin Rataj <lidel@lidel.org>
@lidel lidel added the skip/changelog This change does NOT require a changelog entry label Jun 5, 2026
@lidel lidel changed the title chore: bump boxo to test ipfs/boxo#1166 fix: bound ipns caching and validate lifetimes Jun 5, 2026
@lidel lidel removed the skip/changelog This change does NOT require a changelog entry label Jun 5, 2026
ipfs name publish now sanitizes its duration flags instead of emitting
a record that fails verification later: a non-positive --lifetime and a
negative --ttl are rejected, an explicit --ttl over --lifetime is
rejected, and an omitted --ttl is capped to --lifetime. The --lifetime
and --ttl defaults are applied server-side so an explicit value is
distinguishable from the default.

The daemon also refuses to start when Ipns.RecordLifetime is shorter
than Ipns.RepublishPeriod, which would let records expire before they
are republished.

Signed-off-by: Marcin Rataj <lidel@lidel.org>
@lidel lidel force-pushed the bump-boxo-ipns-cache-control branch from ca0361e to 2e14dcb Compare June 5, 2026 17:40
@lidel lidel marked this pull request as ready for review June 5, 2026 18:12
@lidel lidel requested a review from a team as a code owner June 5, 2026 18:12
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.

1 participant