Skip to content

chore: repo-wide security hardening — ZAP, Scorecard, and CodeQL fixes #356

@Aureliolo

Description

@Aureliolo

Context

Audit of ZAP DAST scan, OSSF Scorecard, and CodeQL alerts revealed several untracked hardening items. All items below are code-changeable fixes (admin-only settings like rulesets and GitHub security toggles are handled separately).

Acceptance Criteria

Scorecard fixes

  • Pin sandbox Dockerfile images by digestdocker/sandbox/Dockerfile uses node:22-slim and python:3.14-slim without @sha256:... digests (backend + web Dockerfiles already pinned)
  • Pin wrangler install by npm hash.github/workflows/pages-preview.yml:236 uses npm i --no-save wrangler@3.114.17 which Scorecard flags as unpinned npmCommand

ZAP DAST fixes

  • Return 404 for unmatched routesexception_handlers.py catches Exception (including Litestar's NotFoundException) and returns 500. Add explicit NotFoundException handler → 404
  • Add Cross-Origin-Resource-Policy: same-origin header — missing from app.py response_headers list (other security headers already present)
  • Add Cache-Control headers/health and /openapi.json have no cache directives. Add no-store for health, short max-age for OpenAPI schema
  • Suppress ZAP auto-created issues — ZAP action creates issue ZAP API Scan Report #355 on every run; set issue_action: false in workflow to use artifacts only

CodeQL fixes

  • Suppress js/log-injection false positivesweb/src/stores/websocket.ts:92,100 already use sanitizeForLog() but CodeQL doesn't recognize it. Add CodeQL suppression comments or a custom .github/codeql/ config
  • Suppress untrusted-checkout alertpages-preview.yml:94 already mitigated (no secrets, persist-credentials:false). Add CodeQL inline suppression

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    prio:highImportant, should be prioritizedscope:large3+ days of workspec:securityDESIGN_SPEC Section 12 - Security & Approval Systemtype:choreMaintenance, cleanup, dependency updates

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions