Skip to content

fix(security): 1.6.1 candidates - batch bypass, prototype-name bypass, HTTP Origin check, status runId guard - #23

Open
Paraphern wants to merge 1 commit into
mainfrom
dev/161-security-fixes
Open

Paraphern wants to merge 1 commit into
mainfrom
dev/161-security-fixes

Conversation

@Paraphern

Copy link
Copy Markdown
Owner

Security patch 1.6.1 (from external report, all four findings confirmed and fixed).

Fixes

  • F-1 [P1] JSON-RPC batch bypass: enforce mode rejects batch arrays outright (-32600, event batch-reject); observe forwards with batch-forward log. Both proxies.
  • F-2 [P1] prototype-name bypass: all pin-store lookups now own-property only (Object.hasOwn) - constructor/toString/proto can no longer resolve through Object.prototype as phantom pins. proxy.js, proxy-http.js, pins.js, skills-pin.js. Normal NEW/undeclared semantics preserved.
  • F-3 [P2] HTTP Origin check: foreign Origin gets 403 (cross-origin-reject event); loopback on actual port allowed; non-browser clients unaffected. Guard runs before all other gates.
  • F-4 [P2] status runId guard: existing.runId >= our runId skips publish - a stale re-run can no longer overwrite a fresher status. Bonus: portable readFileSync(0) instead of /dev/stdin (latent Windows ENOENT).

Verification

  • Full suite: 531/531 (5 new tests: batch x2, prototype names, Origin, runId simulation)
  • Independent review: all four verified live (batch rejected before server, proto names blocked while pinned tools pass, Origin 403, runId 200 vs 100 skip); backward compat confirmed on regular pin stores

Merge target: 1.6.1 patch release.

…in check, status runId guard (1.6.1 candidates)

- F-1 (P1): JSON-RPC batch arrays rejected outright in enforce (both proxies)
  with -32600; forwarded with a log line in observe
- F-2 (P1): all pin-store lookups are own-property only (Object.hasOwn) -
  constructor/toString/__proto__ never resolve through Object.prototype;
  fixed in proxy.js, proxy-http.js (gate + policy lookup) and pins.js
  (pinTool, getToolPin, compareTools), skills-pin.js
- F-3 (P2): HTTP proxy rejects foreign Origin headers (403, loopback-only)
  - CSRF vector closed; no-Origin clients unaffected
- F-4 (P2): publish-status.sh runId guard - a stale re-run (older runId,
  newer wall clock) can no longer overwrite a newer run status; also fixes
  a latent Windows bug (readFileSync /dev/stdin -> fd 0)

Tests: 5 new (batch stdio/http, proto names stdio, Origin 403, runId sim
with a local bare remote). Full suite: 531/531, exit 0.
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.

1 participant