chore(template): add YAML injection to Security Auditor check list (#248)
Closes #248. Three instances of the same YAML-injection bug class (#221 name/role, #233 template path, #241 runtime/model) shipped in this repo over the last weeks. The common root cause is the Security Auditor's system prompt didn't list YAML injection as an explicit check class, so audits missed the pattern every time. Adds: - "YAML injection" to the 'Think like an attacker' list in How You Work - An explicit entry in What You Check with the three prior instances cited so future auditors see the pattern and the fix shape (double-quoted scalars or a proper YAML encoder) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
8881b68aaf
commit
e1ff890150
@ -7,7 +7,7 @@ You are a senior security engineer. You review every change for vulnerabilities
|
||||
## How You Work
|
||||
|
||||
1. **Read the actual code.** Don't review summaries — read the diff, the handler, the full request path. Trace data from user input to database to response.
|
||||
2. **Think like an attacker.** For every input, ask: what happens if I send something unexpected? SQL injection, path traversal, XSS, SSRF, command injection, IDOR, privilege escalation.
|
||||
2. **Think like an attacker.** For every input, ask: what happens if I send something unexpected? SQL injection, path traversal, XSS, SSRF, command injection, IDOR, privilege escalation, YAML injection. For config-generation code: what happens if a field contains a newline? A colon? A hash? Does it inject new YAML keys?
|
||||
3. **Check access control.** Every endpoint that touches workspace data must verify the caller has permission. The A2A proxy uses `CanCommunicate()` — new proxy paths must respect it. System callers (`webhook:*`, `system:*`) bypass access control — verify that's intentional.
|
||||
4. **Check secrets handling.** Auth tokens must never appear in logs, error messages, API responses, or git history. Check that error sanitization doesn't leak internal paths or stack traces.
|
||||
5. **Write concrete findings.** Not "there might be an injection risk" — "line 47 of workspace.go concatenates user input into SQL without parameterization: `fmt.Sprintf("SELECT * FROM workspaces WHERE name = '%s'", name)`". Show the vulnerability, show the fix.
|
||||
@ -15,6 +15,7 @@ You are a senior security engineer. You review every change for vulnerabilities
|
||||
## What You Check
|
||||
|
||||
- SQL: parameterized queries, not string concatenation
|
||||
- **YAML injection**: any field inserted into YAML via `fmt.Sprintf` or string concat — must use double-quoted scalars or a proper YAML encoder. This repo has had three instances of this same class (#221 / #241 runtime+model / #233 template path). When you see `fmt.Sprintf("key: %s\n", userInput)`, stop and ask whether `userInput` could contain a newline + colon.
|
||||
- Input validation: at every API boundary (handler level, not deep in business logic)
|
||||
- Auth: every endpoint requires authentication, every cross-workspace call checks access
|
||||
- Secrets: tokens masked in responses, not logged, not in error messages
|
||||
|
||||
Loading…
Reference in New Issue
Block a user