Skip to content

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

Open
sfc-gh-ikryvanos wants to merge 1 commit into
mainfrom
fix/mpa-store-payload-limit
Open

fix(mpa): bound size of stored approval payloads#633
sfc-gh-ikryvanos wants to merge 1 commit 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>
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