Skip to content

M2-L01: docs(protocol): clarify session-key authorization scope and metadata extensibility#711

Merged
philanton merged 1 commit into
fix/audit-findings-r2from
docs/m2-l01-session-key-scope
Apr 27, 2026
Merged

M2-L01: docs(protocol): clarify session-key authorization scope and metadata extensibility#711
philanton merged 1 commit into
fix/audit-findings-r2from
docs/m2-l01-session-key-scope

Conversation

@philanton
Copy link
Copy Markdown
Contributor

Summary

Audit finding M2-L01 (Low) flagged that channel session keys are authorized today only by asset and expiration, with no per-action, channel, recipient, or spending-limit enforcement. We are acknowledging the finding without changing runtime behaviour for now, and tightening the protocol documentation so the actual scope is explicit and the metadata extension model is unambiguous.

Changes

  • docs/protocol/cryptography.md
    • Replaces the loose "scope, expiration and possible other data" phrasing with a reference to the canonically encoded authorization metadata structure.
    • Adds an Authorization Metadata subsection that:
      • Lists version and expires_at as the protocol-mandated minimum.
      • Explains that version is a replay / revocation guard — issuing a higher-version session-key state supersedes (revokes) prior ones — not a metadata-layout version.
      • States that implementations MAY extend the metadata with additional restrictions (authorized assets, allowed transitions, channels, recipients, spending limits, …), and that any dimension an implementation does not encode and enforce is not narrowed: a session key can sign any otherwise-valid state along that dimension up to the participant's full balance until expiry.
      • Documents the rationale for binding only the keccak256 of the metadata into the authorization signature: implementations can extend the structure off-chain without on-chain validator changes and without invalidating session keys issued under earlier layouts.
  • docs/protocol/terminology.md
    • Removes the misleading "specific types of state updates" wording from the Session Key entry, links it to the cryptography section, and notes that a participant delegating a session key SHOULD assume it may exercise any authority not narrowed by the scope it issued.

assets is intentionally not promoted to the protocol minimum — it is an existing implementation-level extension and remains documented as such by omission from the minimum scope and inclusion in the example list of optional restrictions.

Test plan

  • Docs-only change; no code paths affected.
  • Visual review of the rendered Markdown for the two modified files.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9e774672-de2a-4bfe-b87f-3c36595ef7a5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/m2-l01-session-key-scope

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…etadata extensibility

Audit finding M2-L01 noted that channel session keys are authorized only by
asset and expiration, with no per-action, recipient, amount or channel
restriction. Finer-grained scope is intentionally not added at this time;
update the protocol documentation so this is explicit instead of
under-specified.

Cryptography:
- Replace the loose "scope, expiration and possible other data" phrasing
  with a reference to the canonically encoded authorization metadata
  structure.
- Add an "Authorization Metadata" section that defines the protocol
  minimum (`version`, `expires_at`) and explains that `version` is a
  replay/revocation guard whose increment supersedes prior delegations.
- Document that implementations MAY extend the metadata with additional
  restrictions (authorized assets, allowed transitions, channels,
  recipients, spending limits, ...), and that any dimension an
  implementation does not encode and enforce is not narrowed: a session
  key can sign any otherwise-valid state along that dimension up to the
  participant's full balance until expiry.
- Document the rationale for binding only the `keccak256` of the metadata
  into the authorization signature: implementations can extend the
  structure off-chain without on-chain validator changes and without
  invalidating session keys issued under earlier metadata layouts.

Terminology:
- Drop the misleading "specific types of state updates" wording from the
  Session Key entry and link to the cryptography section, noting that a
  participant delegating a session key SHOULD assume it may exercise any
  authority not narrowed by the scope it issued.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@philanton philanton force-pushed the docs/m2-l01-session-key-scope branch from 144a68e to 713772a Compare April 27, 2026 10:39
@philanton philanton merged commit 5f32e2a into fix/audit-findings-r2 Apr 27, 2026
3 checks passed
@philanton philanton deleted the docs/m2-l01-session-key-scope branch April 27, 2026 11:27
nksazonov added a commit that referenced this pull request Apr 28, 2026
M2-I02: fix(clearnode/api): normalize participant addresses consistently across endpoints (#712)
M2-L01: docs(protocol): clarify session-key authorization scope and metadata extensibility (#711)
M2-M01: fix(clearnode): alert on home channel challenge instead of auto-checkpoint (#710)
M2-H01: fix(contracts/ChannelHub): add finalize escrow home chain intent check (#704)
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