im-shashanks/claude-plugins / shaktra/skills/shaktra-quality
shaktra-quality
VerifiedQuality engine for the TDD pipeline — provides quick-check (36 checks) for gate reviews and comprehensive review (14 dimensions) for final quality assessment. Loaded by sw-quality agent.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 3.5 KB |
| architecture-checks.md | markdown | 6.4 KB |
| comprehensive-review.md | markdown | 6.5 KB |
| performance-data-checks.md | markdown | 6.5 KB |
| quick-check.md | markdown | 13.1 KB |
| security-checks.md | markdown | 6.0 KB |
security-checks.md
View on GitHub# Security Checks
Gate-specific security checks loaded by sw-quality during code and test review. Aligned with OWASP Top 10. These checks detect the most critical security vulnerabilities that commonly ship to production.
---
## Code Gate — Security Checks
### SE-01: Injection via String Interpolation
- **Severity:** P0
- **Detection:** String interpolation (f-strings, template literals, string concat, format()) containing user input used in SQL, shell commands, OS commands, LDAP queries, or template rendering
- **Example (bad):** `db.query(f"SELECT * FROM users WHERE id = {request.id}")`
- **Example (good):** `db.query("SELECT * FROM users WHERE id = ?", [request.id])`
- **Scope:** Any code path reachable from user input (request params, body, headers, query strings, file uploads)
### SE-02: Password Without Proper Hashing
- **Severity:** P0
- **Detection:** Password stored or compared using MD5, SHA-1, SHA-256 (without proper KDF), or plaintext. Look for `hashlib.md5`, `hashlib.sha1`, `crypto.createHash('md5')`, or password stored directly.
- **Example (bad):** `hashed = hashlib.sha256(password.encode()).hexdigest()`
- **Example (good):** `hashed = bcrypt.hashpw(password.encode(), bcrypt.gensalt(rounds=12))`
### SE-03: IDOR — Data Access Without Ownership Check
- **Severity:** P0
- **Detection:** Database query fetching a resource by ID from request parameters without filtering by the authenticated user's identity
- **Example (bad):** `order = db.get(Order, id=request.params.order_id)`
- **Example (good):** `order = db.get(Order, id=request.params.order_id, user_id=current_user.id)`
- **Note:** Some endpoints (admin, public data) legitimately skip ownership checks — verify the endpoint's authorization model
### SE-04: Missing Authorization on Endpoint
- **Severity:** P0 (public endpoint that should be protected) / P1 (inconsistent auth middleware)
- **Detection:** Route/endpoint handler without authentication/authorization middleware or decorator when similar endpoints in the same module have auth
- **Example (bad):** `@app.route("/admin/users") def list_users(): ...` — no auth decorator
- **Example (good):** `@app.route("/admin/users") @require_role("admin") def list_users(): ...`
### SE-05: Debug Mode in Production Path
- **Severity:** P0
- **Detection:** `DEBUG=True`, `debug: true`, `app.debug = True`, verbose error handlers, or development-only middleware in production configuration or without environment guard
- **Example (bad):** `app = Flask(__name__); app.debug = True`
- **Example (good):** `app.debug = os.environ.get("FLASK_DEBUG", "false").lower() == "true"`
### SE-06: Weak Crypto Algorithm
- **Severity:** P0
- **Detection:** Use of DES, 3DES, RC4, MD5 (for security), SHA-1 (for security), AES-ECB, RSA-1024 in security-critical code (not checksums or non-security hashing)
- **Example (bad):** `cipher = AES.new(key, AES.MODE_ECB)`
- **Example (good):** `cipher = AES.new(key, AES.MODE_GCM, nonce=nonce)`
### SE-07: SSRF via User-Controlled URL
- **Severity:** P0
- **Detection:** HTTP request (requests.get, fetch, urllib) where the URL or hostname comes from user input without allowlist validation
- **Example (bad):** `response = requests.get(request.params.webhook_url)`
- **Example (good):** `if urlparse(url).hostname in ALLOWED_HOSTS: response = requests.get(url)`
### SE-08: Credential/PII in Log Output
- **Severity:** P0
- **Detection:** Logging statements that output passwords, tokens, API keys, bearer tokens, credit card numbers, SSNs, or full user objects that contain sensitive fields
- **Example (bad):** `logger.info(f"Login attempt: user={email}, password={password}")`
- **Example (good):** `logger.info(f"Login attempt: user={email}")`
### SE-09: Insecure Random for Security Purpose
- **Severity:** P0
- **Detection:** `math.random()`, `random.randint()`, `Math.random()`, `rand()` used for tokens, session IDs, passwords, nonces, or cryptographic keys
- **Example (bad):** `token = ''.join(random.choices(string.ascii_letters, k=32))`
- **Example (good):** `token = secrets.token_urlsafe(32)`
### SE-10: Dependency Without Version Pinning
- **Severity:** P1
- **Detection:** Package dependency without version constraint (no lock file, or `*` / `latest` as version)
- **Example (bad):** `"lodash": "*"` or `pip install requests` without lock file
- **Example (good):** `"lodash": "^4.17.21"` with `package-lock.json`
### SE-11: Missing Security Headers
- **Severity:** P2
- **Detection:** Web application response without security headers (HSTS, CSP, X-Content-Type-Options, X-Frame-Options, Referrer-Policy). Check middleware/framework configuration.
- **Note:** API-only services may not need all headers — apply contextually
### SE-12: Auth Failure Without Logging
- **Severity:** P1
- **Detection:** Authentication failure code path (wrong password, invalid token, expired session) without a log statement
- **Example (bad):** `if not verify_password(pw, hash): return 401`
- **Example (good):** `if not verify_password(pw, hash): logger.warning(f"Failed login: {email}"); return 401`
---
## Test Gate — Security Test Checks
### ST-01: No Injection Test for Input Endpoint
- **Severity:** P1
- **Detection:** Endpoint that accepts user input (POST/PUT/PATCH with body, GET with query params) without a test that sends injection payloads (SQL special chars, script tags, command separators)
- **What to verify:** Test exists that sends `'; DROP TABLE`, `<script>`, `| ls`, etc. and verifies safe handling
### ST-02: No Authorization Test for Protected Endpoint
- **Severity:** P1
- **Detection:** Protected endpoint without a test that verifies unauthorized access returns 401/403
- **What to verify:** Test exists that calls the endpoint without auth (or with wrong auth) and asserts rejection
### ST-03: No IDOR Test for User-Scoped Data
- **Severity:** P1
- **Detection:** Endpoint that returns user-specific data without a test where user A tries to access user B's resource
- **What to verify:** Test exists that authenticates as user A and requests user B's resource, asserting 403 or 404
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |