Skip to content

audit: fix all security and code quality violations#5

Merged
GsCommand merged 1 commit into
mainfrom
claude/audit-commandlayer-protocol-O05aO
May 14, 2026
Merged

audit: fix all security and code quality violations#5
GsCommand merged 1 commit into
mainfrom
claude/audit-commandlayer-protocol-O05aO

Conversation

@GsCommand
Copy link
Copy Markdown
Contributor

- src/index.js: replace console.log with structured stderr write; add
  express-rate-limit on /mcp endpoint (100 req/15 min per IP)
- src/lib/receiptSchema.js: fix version literal 1.0.0→1.1.0; tighten ts
  field to ISO-8601 regex; add z.record guard on input/output to prevent
  raw unknown leaking through zod .unknown()
- src/lib/commandlayerApi.js: add 10 s AbortController timeout on every
  fetch to runtime; surface timeout as RUNTIME_TIMEOUT status
- src/lib/ensResolver.js: resolve all ENS TXT keys in parallel via
  Promise.all instead of sequential for-loop; add 8 s timeout guard;
  validate name is non-empty string before hitting provider
- src/lib/canonicalize.js: replace dead comment-only stub with a real
  canonical JSON implementation (sorted keys, deterministic) so the file
  is no longer dead code — exported as canonicalizePayload()
- src/lib/receiptVerifier.js: replace dead comment-only stub with a real
  local Ed25519 signature verifier using Node crypto WebCrypto API;
  exported as verifyReceiptSignatureLocally()
- src/tools/resolveAgent.js: validate agent param is a non-empty string
  matching ENS name pattern before making network call
- src/tools/getProtocolVersion.js: read runtime_url from env instead of
  hardcoding it
- src/registry/actions.js: fix schema_path for sign (sign→signing) and
  endorse (endorse→endorsing); both paths previously pointed to
  non-existent directories
- examples/protocol-grade-receipt.example.json: replace stale pre-v1.1
  format (payload/hash/signature) with correct v1.1.0 receipt structure
  matching receiptSchema; remove placeholder strings
- package.json: add express-rate-limit dependency; add engines field;
  add lint/typecheck scripts
- README.md: fix COMMANDLAYER_VERIFY_PATH default doc (was /api/verify,
  code default is /verify); fix discrepancy
- test/tools.test.js: update makeValidReceipt to use version 1.1.0 to
  match the corrected receiptSchema literal
@GsCommand GsCommand merged commit 9bb745e into main May 14, 2026
1 check failed
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