Skip to content

2001105254-netizen/RacePulsePH / .agents/skills/racepulse-appsec-deep

racepulse-appsec-deep

Verified

Review RacePulsePH application and protocol security across secrets rotation, IAM, token revocation, TLS, CORS allowlists, CSRF avoidance, XSS/HTML escaping and SSRF prevention. Use when adding or modifying Cloud Functions, LAN endpoints, outbound fetches or email templates.

RacePulse application security deep review

Apply protocol and application security controls to Cloud Functions (functions/), the LAN server (server.ts) and browser components (src/). Complements racepulse-security-prelaunch and racepulse-access.

Load with: racepulse-access, racepulse-security-prelaunch. Rules upheld: C-2, C-4, C-5, R-02, R-33, R-35, R-36. Detail: protocol and vulnerability checks.

Checklist

CheckReasonEvidence
Bind only the secrets a Function actually reads in onRequest({ secrets: [...] })Limits blast radius so a payment function never loads SMTP credentials and vice versaCompare secrets arrays in functions/index.js and functions/auth-api.js
Pass checkRevoked = true into admin.auth().verifyIdToken(token, true) on every authenticated endpointImmediately rejects tokens from disabled accounts or post-password-reset sessionsInspect verifyIdToken calls in functions/index.js, functions/auth-api.js, functions/race-bib-claim-api.js and functions/access-api.js
Enforce explicit origin allowlists (allowedOrigins + Vary: Origin) on Cloud Functions CORS responsesBlocks arbitrary third-party origins from reading authenticated Function responsesInspect setCors in functions/index.js and functions/race-bib-claim-api.js and cors in functions/auth-api.js
Authenticate state-changing requests with Authorization: Bearer headers or HMAC signatures (paymongo-signature, X-RacePulse-Bridge-Key) instead of ambient cookiesEliminates cross-site request forgery (CSRF) on POST, PATCH and DELETE routesConfirm no endpoint relies on automatic browser cookie credentials
Compare secrets, reset codes, webhook HMACs and bridge keys with crypto.timingSafeEqual after length checksPrevents byte-by-byte timing side-channel leaksInspect verifyWebhookSignature (functions/index.js), checkCode (functions/account-security.js) and /api/rfid-events (server.ts)
Escape all user-supplied values in HTML email templates (functions/account-email.js) and never pass untrusted strings to dangerouslySetInnerHTMLPrevents XSS in transactional emails and browser viewsInspect functions/account-email.js and grep dangerouslySetInnerHTML in src/
Hardcode outbound hosts (api.paymongo.com, smtp.gmail.com, fixed accessApi endpoint) and never fetch a caller-supplied URLPrevents server-side request forgery (SSRF) from Cloud Functions or server.tsGrep fetch( across functions/ and server.ts and confirm every target URL is fixed by server config

Stack mapping

  • TLS and encryption in transit: enforced by Firebase Hosting, cloudfunctions.net, https://api.paymongo.com and smtp.gmail.com (port: 465, secure: true in functions/auth-api.js).
  • WAF and DDoS protection: managed at the Google Cloud / Firebase edge; reinforced at the application layer by maxInstances: 10 (functions/auth-api.js), 8192 byte body caps and accountRateLimits.

Not covered

  • Role definitions and capability matrices belong to racepulse-access.

Verify

  1. Run node --test on security tests or npm run verify:rbac to confirm token, CORS and policy checks pass.
  2. Deliver the PASS/FAIL report with file and line citations and a 1-line purpose log.
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: 471kUpdated Claude CodeCodexVerifiedInstall
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: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall