fix: throttle writes, bound mcp inputs, harden oauth consent#117
Closed
FrkAk wants to merge 1 commit into
Closed
Conversation
9a5ace5 to
3aac3b4
Compare
3aac3b4 to
63604fa
Compare
baf54f8 to
0fdfe18
Compare
0fdfe18 to
8a5e3ae
Compare
Owner
Author
|
Superseded by #118, which carries the identical commit on a branch without the Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Task Reference: none (security-review hardening; no associated Mymir task)
Addresses the high/medium findings from the security review that map to hosted-cost abuse and OAuth client spoofing. Dynamic client registration stays open (the standard MCP onboarding pattern); the fixes target what rides along with it rather than registration itself.
Cost / abuse (hosted):
/api/*middleware limiter./api/mcp(MCP_MAX_BODY_BYTES) plus generous per-field/array ceilings — anti-abuse, not content policy; long unabridged plans still pass.MAX_TASKS_PER_PROJECT, default 50k) as a growth backstop.OAuth consent spoofing:
client_idallowlist (empty by default), so an unverified dynamically-registered client renders its raw registered name and cannot impersonate a trusted brand.Agent prompt-injection defense-in-depth:
Type of change
Testing
bun run devbun run lint)bun run typecheck)Notes for reviewer
DB-backed test suites and
bun run devwere not run in the sandbox (no Docker/Postgres available); affected golden snapshots were updated by hand and a regression test added for the register rate-limit rule. Tunable env knobs:MCP_MAX_BODY_BYTES,MAX_TASKS_PER_PROJECT,MYMIR_VERIFIED_OAUTH_CLIENT_IDS.