fix(mcp): validate open pr pressure input#4381
Merged
Merged
Conversation
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4381 +/- ##
=======================================
Coverage 93.95% 93.95%
=======================================
Files 400 400
Lines 36817 36820 +3
Branches 13451 13451
=======================================
+ Hits 34592 34595 +3
Misses 1569 1569
Partials 656 656
🚀 New features to boost your workflow:
|
This was referenced Jul 9, 2026
Closed
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.
Motivation
gittensory_simulate_open_pr_pressureaccepted unbounded/malformedqueueHealthandroleContext(viaz.unknown()), allowing authenticated callers to cause runtime TypeErrors or reflect large payloads into output.Description
z.unknown()inputs with a boundedqueueHealthschema (simulateOpenPrPressureQueueHealthSchema) that validates pressurelevel, numeric signal counts, limitedfindingsand reasonable string lengths, and addSIMULATE_OPEN_PR_PRESSURE_MAX_COUNTto cap numeric fields.roleContextminimally as an object withmaintainerLane: booleanwhile using.passthrough()so the fuller engine context is preserved.repoFullName,generatedAt, andcontributorOpenPrCountwith length/number bounds to avoid oversized inputs.roleContext: null, missing/ill-formedqueueHealth.signals, and oversized/string queue counts so malformed inputs fail at schema validation instead of crashing or being reflected in output.Testing
npm run build:minerand the build succeeded.npx vitest run test/unit/mcp-simulate-open-pr-pressure.test.tsand all tests in that file passed.npm run typecheckand TypeScript typecheck passed.npx vitest run --coverage test/unit/mcp-simulate-open-pr-pressure.test.tsthe tests passed but coverage remapping failed withTypeError: jsTokens is not a function; a fullnpm run test:coveragerun did not complete in this environment.npm audit --audit-level=moderatecould not be completed due to the registry audit endpoint returning403 Forbiddenin this environment.Codex Task