Skip to content

Conversation

@reverentgeek
Copy link
Collaborator

Summary

Address security review findings for the Core Exchange reference implementation:

  • IOH-IV-01: Add comprehensive input validation using Zod with allow-list approach
  • SA-SPD-02: Document and enforce sensitive data handling practices
  • CM-BD-01: Implement automated CI/CD pipelines with security scanning

Changes

Input Validation

  • Zod validation for pagination, path params, dates, login, API endpoints
  • Timing-safe password comparison
  • XSS protection for OAuth error messages

Sensitive Data Handling

  • Root .env.example template
  • Enhanced .gitignore for secrets/keys
  • Security documentation in CLAUDE.md

Build & Deployment

  • CI workflow for PR validation (lint, build, audit)
  • Security scanning workflow (CodeQL, Trivy)
  • Dependabot for automated dependency updates
  • Multi-stage Dockerfiles for all services
  • docker-compose configurations

Documentation

  • SECURITY.md with vulnerability reporting policy
  • Security and Docker/CI sections in README

Implements thorough input validation using positive (allow-list) approaches
for all external data sources to prevent injection attacks and set security
best practices for the example project.

Changes:
- Add Zod v4 validation library to shared package
- Create validation schemas: pagination bounds, account/statement IDs,
  date ranges, email/password, API endpoints, HTTP methods, OIDC clients, JWKS
- Update API routes with validated path params and query params
- Update Auth routes with login validation and timing-safe password comparison
- Update App routes with API Explorer endpoint allow-list and XSS protection
- Add safe JSON parsing utilities and HTML escaping for error messages
- Create root-level .env.example template with security documentation
- Enhance .gitignore with additional sensitive file patterns (keys, certs, secrets)
- Document sensitive data handling in CLAUDE.md including:
  - Environment variable security levels
  - Template configuration file locations
  - Production secrets generation instructions
  - Security checklist for deployment
CI/CD Workflows:
- ci.yml: PR validation with lint, build, and security audit
- security.yml: Weekly CodeQL analysis and Docker image scanning
- dependabot.yml: Automated dependency updates for npm and GitHub Actions

Docker Support:
- Multi-stage Dockerfiles for auth, api, and app services
- docker-compose.yml for local development
- docker-compose.prod.example.yml as production template
- .dockerignore to exclude secrets and dev files

Documentation:
- CI/CD and Build Processes section in CLAUDE.md
- Deployment security checklist
- Branch protection recommendations
- Create SECURITY.md with vulnerability reporting guidelines and security policy
- Add Security section to README with features table and production checklist
- Add Docker and CI/CD section to README with build commands and workflows
- Document dependency security tools (Dependabot, npm audit, CodeQL, Trivy)
@reverentgeek reverentgeek merged commit c4454a5 into main Jan 14, 2026
3 checks passed
@reverentgeek reverentgeek deleted the dn-add-input-validation branch January 14, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants