Skip to content

fix(mpa): bound size of stored approval payloads - #633

Merged
sfc-gh-ikryvanos merged 3 commits into
mainfrom
fix/mpa-store-payload-limit
Aug 27, 2026
Merged

fix(mpa): bound size of stored approval payloads#633
sfc-gh-ikryvanos merged 3 commits into
mainfrom
fix/mpa-store-payload-limit

Conversation

@sfc-gh-ikryvanos

Copy link
Copy Markdown
Collaborator

Store kept up to a fixed number of approval entries but placed no limit on the caller-controlled Any payload in each one, so a caller could pin a large amount of heap in the root server. Reject requests whose encoded size exceeds a per-request cap, track total stored bytes, and evict oldest entries to stay within a total budget.

The two limits are exported package vars (MaxMessageBytes, MaxTotalBytes) and bound to the sansshell-server flags --mpa-max-message-bytes and --mpa-max-total-bytes, following the existing configuration convention. A value <= 0 disables the corresponding check. Adds regression tests for both bounds, byte accounting, and configurability.

Store kept up to a fixed number of approval entries but placed no limit on
the caller-controlled Any payload in each one, so a caller could pin a
large amount of heap in the root server. Reject requests whose encoded
size exceeds a per-request cap, track total stored bytes, and evict oldest
entries to stay within a total budget.

The two limits are exported package vars (MaxMessageBytes, MaxTotalBytes)
and bound to the sansshell-server flags --mpa-max-message-bytes and
--mpa-max-total-bytes, following the existing configuration convention. A
value <= 0 disables the corresponding check. Adds regression tests for
both bounds, byte accounting, and configurability.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sfc-gh-ikryvanos
sfc-gh-ikryvanos enabled auto-merge (squash) August 27, 2026 09:41
@sfc-gh-ikryvanos
sfc-gh-ikryvanos merged commit 0010feb into main Aug 27, 2026
7 checks passed
@sfc-gh-ikryvanos
sfc-gh-ikryvanos deleted the fix/mpa-store-payload-limit branch August 27, 2026 11:24
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