Fix security scan findings: confirm gate, exit codes, redaction, CI tag env (#180)
- Gate rules push behind --yes at CLI and domain layers (fail-closed on
dryRun=false without confirm)
- Raise webhook replay partial failure as CliError so exit 1 survives
cli.ts exitCode overwrite; route webhook stdout through printJson for
exit-12 protection and --output-file support
- Narrow MCP read-only allowlist: drop config mode/lint (write forms are
indistinguishable under token-prefix matching; config get covers reads)
- Extract redactSensitiveText to core, extend credential patterns, apply
to HTTP sendError/500 and domain error messages
- Pass release TAG_NAME via env instead of inline ${{ }} interpolation
to close script injection through crafted tag names
- Track .zcodeignore so enterprise credential exclusions travel with the
repo
- Add .agents/rules/security-posture.md documenting usability-first
accepted risks (loopback adapter auth, update verification, mutation
command gates, skill dump stdout); register skill dump as a documented
stdout Markdown exception in AGENTS.md and cli-protocol.md
- Rebuild dist/mcp/server.js
This commit is contained in:
1 parent
3d9df01c31
commit
f8e083f3b2
15 files changed
+283
-151
No files matched your search
+2
-1
@@ -1,5 +1,6 @@
|
||||
import { createServer, type Server } from "node:http";
|
||||
import { handleHttpRequest } from "./routes.js";
|
||||
import { redactSensitiveText } from "../core/redact.js";
|
||||
import { VERSION } from "../version.js";
|
||||
|
||||
export type HttpServerOptions = {
|
||||
@@ -21,7 +22,7 @@ export async function startHttpServer(options: HttpServerOptions = {}): Promise<
|
||||
} catch (err) {
|
||||
if (!res.headersSent) {
|
||||
res.writeHead(500, { "Content-Type": "application/json" });
|
||||
res.end(JSON.stringify({ error: true, message: err instanceof Error ? err.message : String(err) }));
|
||||
res.end(JSON.stringify({ error: true, message: redactSensitiveText(err instanceof Error ? err.message : String(err)) }));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user