
sswandClaude
2c6e92d3e9
fix(security): P4 — spawn over execSync, token 0600, env-only crypto key
Per audit §8 / H2 / H3 / M4:
- form/create.ts AI-relogin: execSync(`...--password=123456...`) → spawnSync
array form (no shell → no command injection via cliEntry/appCode); creds from
config DEFAULT_ACCOUNT/DEFAULT_PASSWORD (env-overridable), no inline literal
- config.ts saveToken: token.json 0600 + dir 0700 + chmod fallback for existing
0644 files (token holds bearer, was world-readable)
- crypto.ts: drop hardcoded FALLBACK_KEY ('EY8...'); missing key → throw (refuse
to encrypt with weak key under AES-ECB) instead of silent weak fallback
- @types/pg already installed in P1 (kb SQL client no longer any-typed)
Verified: tsc 0; crypto still loads key from web/.env (96-char hex, no throw →
login intact in container); vitest unit 336 pass (blindspot_guards quarantined).
Co-Authored-By: Claude <[email protected]>
2026-07-24 10:42:51 +08:00
..
2026-07-24 10:42:51 +08:00
2026-07-24 10:42:51 +08:00
2026-06-22 15:33:48 +08:00
2026-06-24 14:36:23 +08:00
2026-07-23 15:16:28 +08:00
2026-06-30 18:53:38 +08:00
2026-07-17 08:59:51 +08:00