lidge-jun/codexclaw / plugins/codexclaw/skills/dev-security
cxc-dev-security
FlaggedUse for security and trust boundaries. Triggers: auth, secrets, XSS, CSRF, SQL injection, JWT, OAuth, OWASP, PII, uploads, payments, supply chain, CI integrity, agent security, threat model.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.0 KB |
| agents/openai.yaml | config | 158 B |
| references/01-threat-model.md | markdown | 1.3 KB |
| references/02-access-controls.md | markdown | 3.3 KB |
| references/03-runtime-controls.md | markdown | 3.6 KB |
| references/04-agent-integrity.md | markdown | 3.3 KB |
| references/05-security-review.md | markdown | 4.9 KB |
| references/agent-skill-integrity.md | markdown | 2.2 KB |
| references/agentic-ai-security.md | markdown | 6.0 KB |
| references/asvs-checklist.md | markdown | 3.1 KB |
| references/language-quirks.md | markdown | 5.0 KB |
| references/llm-supply-chain.md | markdown | 7.4 KB |
| references/mcp-supply-chain.md | markdown | 6.9 KB |
| references/owasp-top10.md | markdown | 11.1 KB |
| references/static-analysis.md | markdown | 4.8 KB |
| references/supply-chain-sbom.md | markdown | 6.7 KB |
references/02-access-controls.md
View on GitHub## 1. Input Validation
Input validation is the first line of defense.
Validate at the first trusted boundary, reject unknown fields, enforce limits, and escape or sanitize on output for the target context.
Client-side validation improves UX only — it is never a security boundary.
**Required rules**
- Validate shape, type, format, enum membership, length, and numeric range.
- Reject unknown fields by default.
- Canonicalize before validation when encoding differences matter.
- Distinguish parsing failures from authorization failures.
- Sanitize HTML only when rich text is explicitly allowed.
- Re-validate on the server even when frontend uses the same schema.
Validate all input at trust boundaries with schema validation (Zod strict, Pydantic `extra="forbid"`, or equivalent). Reject unknown fields. For injection cases, rich text, and output encoding, read `../references/owasp-top10.md` A05 and `../references/language-quirks.md`.
## 2. Authentication Checklist
Use this checklist for login, session, token, password reset, magic link, OAuth, and admin access:
- [ ] Passwords hashed with `argon2id` (preferred); `scrypt` next if unavailable; `bcrypt` mainly for legacy; PBKDF2 only for FIPS-140 contexts. MD5/SHA1/raw SHA256 never for passwords. (OWASP ordering, checked 2026-07-02.)
- [ ] Access tokens are short-lived with reduced scope (RFC 9700). Exact TTLs are risk-based org policy — 15-60 minutes is a common starting range, not a standard-mandated number.
- [ ] Refresh tokens rotate on use and support family invalidation after reuse detection.
- [ ] Browser session tokens use an appropriate httpOnly/secure/SameSite cookie strategy; keep session tokens out of localStorage. For cookie-authenticated state changes, verify framework CSRF protection or an appropriate token/origin/Fetch-Metadata defense; SameSite alone is not sufficient in most deployments.
- [ ] OAuth uses Authorization Code + PKCE; avoid implicit flow (deprecated, token-in-URL exposure).
- [ ] Sensitive actions such as email change, MFA reset, payout change, and password change require step-up auth.
- [ ] Failed logins are rate-limited and delayed progressively.
- [ ] Session invalidation runs after password reset, password change, and privilege change.
- [ ] Password reset tokens are one-time, short-lived, and stored hashed server-side.
- [ ] Auth errors are generic — avoid revealing whether a specific email exists.
See `../references/owasp-top10.md` A07 for implementation patterns.
See `../references/asvs-checklist.md` for the local release checklist and the distinction
from formal ASVS 5.0.0 evidence (Authentication V6, Session Management V7).
## 3. Authorization and Sensitive Flows
Authentication says who the caller is.
Authorization says what the caller may do.
Security failures happen when a route checks only the first.
**Required rules**
- Default deny.
- Enforce RBAC or ABAC before business logic.
- Perform ownership checks on every resource read and write.
- Scope queries by tenant and actor, not only by route.
- Re-check authorization on bulk actions, background jobs, exports, and webhooks.
- Keep internal flags, role names, and hidden fields out of response serializers.
See `../references/owasp-top10.md` A01 for code pairs.
See `../../dev-backend/SKILL.md` §4 for middleware execution order.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 468k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 468k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 468k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |