Vote for your favorite SkillMD. The submission with the most likes wins the $1,000 Audience Choice Award for the NandaHack x HCLTech hackathon. Voting is open through September 25.Vote now →
mergedhumanPR #251Identity

Reject malformed run grant timestamps without changing signed payloads

Reject malformed or non-finite timestamps when verifying current Town run grants, without changing signed payloads or adding permission policy.

Author

JamesCarnley avatar

@JamesCarnley

github profile →
Status
Merged
Merged on
Sep 4
Branch
fix/finite-grant-timestamps

Description

The pitch.

## Summary

Reject malformed or non-finite timestamps when verifying current Town run grants, without changing signed payloads or adding permission policy.

This preserves the finite-timestamp requirement identified in [#126 by Charanarravindaa](https://github.com/projnanda/nandatown/pull/126), reviewed at `d2d1914e641ce54010742b864828bdaeac4c06fa`. It is a fresh current-main verifier fix, not a port of the legacy manifest/delegation implementation.

## Behavior

- Require issuance, expiry and resolved verifier time to be finite numeric timestamps. Reject booleans, strings, missing fields, containers and unrepresentable integers through the existing typed error.
- Validate without rewriting signed fields. Preserve integer/fractional payloads, default clock selection and acceptance at exact expiry equality.
- Preserve grant signature checks, session-key proof, API/schema and existing permissions. Deliberately expired test grants remain constructible.
- Reject malformed joins with the existing 403 and rejection evidence, without creating a session or changing a prior session on rejoin.

## Verification

- TDD: 28 failures / 9 passes before the initial fix, followed by 37 passing cases. Review identified a large-integer clock rounding regression; two new signed boundary tests failed before its correction.
- Final focused suite: **39 passed**. Full integrated suite: **500 passed**, 8 existing warnings.
- Signed malformed issuance/expiry, explicit/default invalid clocks, exact expiry, just-expired controls, unchanged payloads and expired-fixture creation are covered.
- Real in-process HTTP and SQLite tests verify 403, rejection evidence, no session on malformed join and unchanged permissions/session on malformed rejoin.
- Independent expert review passed the corrected implementation and integration with #250. The original validated integer clock is retained for comparison, preserving existing precision and expiry semantics.

## Scope and credit

Credit the author's completed namespace, manifest-tamper validator, cleanup and rebase/CI-environment follow-ups on #126. Historical approval-required CI is not a failed-test rationale for closure.

Manifest policy, hierarchical delegation, attenuation, revocation distribution and atomic budget/approval decisions remain separately designed optional profiles. This fix does not add not-before, maximum-TTL, timestamp-order or post-join-expiry policy. The source stays open until the replacement is merged with selected/deferred scope explained. No legacy contributor code or external identity/provider service was executed.

Try it

Open PR on GitHubView diff

Checkout locally

git fetch origin pull/251/head:pr-251
git checkout pr-251