fix(security): bound focus manifest ingestion - #890
Conversation
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
|
gittensory · advisory review Reviewed 3 changed file(s) — two independent AI reviewers. Changed files: Suggested action: ✅ Safe to merge — both reviewers found no blocking issues. Reviewer A · Suggestions
Worth double-checking
Reviewer B · Suggestions
Worth double-checking
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #890 +/- ##
==========================================
- Coverage 96.72% 96.68% -0.05%
==========================================
Files 109 109
Lines 14750 14775 +25
Branches 5340 5344 +4
==========================================
+ Hits 14267 14285 +18
- Misses 95 102 +7
Partials 388 388 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
…-focus-manifest-vulnerability # Conflicts: # src/api/routes.ts # src/mcp/server.ts
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 248e2c2 | Commit Preview URL Branch Preview URL |
Jun 19 2026, 06:03 AM |
Motivation
focusManifestobjects were accepted and parsed without an overall byte cap, allowing large or malicious manifests to be fully materialized and parsed which can exhaust Worker memory/CPU and crash the process.Description
MAX_FOCUS_MANIFEST_BYTESand add afocusManifestInputSchemathat refines caller-supplied manifests by their JSON-serialized byte length sofocusManifestcannot exceed the configured cap in both the API and MCP schemas (src/api/routes.ts,src/mcp/server.ts).isJsonByteLengthWithinLimithelper used by the schema refinement and wire thefocusManifestfields tofocusManifestInputSchemato enforce the serialized-size bound.LOCAL_BRANCH_ANALYSIS_MAX_BODY_BYTES) and usereadRequestBodyWithLimit+JSON.parsefor the/v1/local/branch-analysisand/v1/local/remediation-planroutes so oversized incoming requests are rejected before full JSON materialization, while preserving the existing repo-owned manifest fallback behavior.Testing
npm test -- --run test/unit/focus-manifest-loader.test.ts test/unit/focus-manifest.test.ts test/unit/openapi.test.ts, and all tests passed (Test Files 3 passed, Tests 115 passed).npm run typecheck(TypeScripttsc --noEmit) and it completed successfully.git diff --checkand it reported no issues.Codex Task