Skip to content

Bound signed ACK receipt storage - #131

Closed
LIghtJUNction wants to merge 1 commit into
mainfrom
codex/fix-unbounded-receipt-storage-vulnerability
Closed

LIghtJUNction wants to merge 1 commit into
mainfrom
codex/fix-unbounded-receipt-storage-vulnerability

Conversation

@LIghtJUNction

Copy link
Copy Markdown
Contributor

Motivation

  • Prevent unbounded durable growth of inbox_receipts caused by arbitrary fresh Ed25519 identities which can exhaust SQLite and degrade availability.

Description

  • Add global and per-post receipt caps by introducing MAX_RECEIPTS_PER_POST and MAX_RECEIPTS_TOTAL in src/msgd/exchange.py and enforce them when inserting a new receipt, returning a StoreError with a 507 status on capacity exhaustion.
  • Only apply the new limits on new INSERT operations so updates to existing receipts continue to work after capacity is reached.
  • Add a regression test test_ack_receipts_enforce_per_post_and_global_capacity in tests/test_msgd.py which patches the limits and verifies per-post rejection, global rejection, and that updating an existing receipt still succeeds.

Testing

  • Ran the focused exchange tests with uv run python -m unittest tests.test_msgd.ExchangeProtocolCase.test_ack_receipts_enforce_per_post_and_global_capacity tests.test_msgd.ExchangeProtocolCase.test_public_ack_receipts_are_unique_signed_reads and they passed.
  • Ran the full test discovery with uv run python -m unittest discover -s tests and the suite completed successfully (146 tests passed, 1 skipped).
  • Ran style checks with uv run ruff check src/msgd/exchange.py tests/test_msgd.py and uv run ruff format --check src/msgd/exchange.py tests/test_msgd.py, both of which succeeded.

Codex Task

Copilot AI lite review requested due to automatic review settings September 28, 2026 11:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-09-28T11:51:43.797746Z 70430a4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@LIghtJUNction

Copy link
Copy Markdown
Contributor Author

已被 #143 取代,关闭。旧补丁打在已删除的 src/msgd 上;现行 src/msg 的对应容量上限在分支 fix/capacity-recovery-20260928(head e77b53b),该分支已包含合并后的 #142。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants