Skip to content

Fix CodeQL easy wins: missing-await + Dockerfile HEALTHCHECK - #173

Merged
keysersoft merged 1 commit into
mainfrom
keysersoft/codeql-easywins
May 12, 2026
Merged

keysersoft merged 1 commit into
mainfrom
keysersoft/codeql-easywins

Conversation

@keysersoft

Copy link
Copy Markdown
Contributor

Summary

Part of the pre-launch CodeQL cleanup. Two small fixes that close two real alerts.

1. `packages/backend/src/settings/site-settings.controller.ts`

`getFooterLinks()` returned the unresolved Promise — `Promise || []` is always truthy so the `|| []` fallback was dead code. Now properly awaited so the empty-array fallback works.

Closes CodeQL alert #72 (`js/missing-await`).

2. `Dockerfile`

Added `HEALTHCHECK` pointing at the backend Terminus `/health` endpoint (port 4000). 30s interval, 5s timeout, 30s start period, 3 retries.

Closes CodeQL alert #3 (`DS-0026`) and gives Docker/K8s/Compose a proper liveness signal.

Test plan

Companion work (separate, not in this PR)

  • 7 SQL injection alerts: dismissed as FPs (prepared queries with bind vars)
  • 30 remote-property-injection alerts: dismissed as admin-only with prototype-pollution hardening tracked as a follow-up
  • 5 request-forgery alerts: dismissed as guarded by `assertSafeOutboundUrl()` SSRF allowlist
  • 7 ReDoS alerts: dismissed as bounded-input/admin-only
  • 4 CVE alerts: 2 dismissed as not-in-our-tree, 2 left to Dependabot
  • Helmet CSP, xss-through-exception, loop-bound-injection: dismissed with rationale
  • 🚨 Open security issue (not in this PR): `login_user` cookie used by OAuth flow is base64-encoded but NOT HMAC-signed. Detailed in a separate report.

1. site-settings.controller.ts: getFooterLinks() returned the unresolved
   Promise (Promise || [] is always truthy → '|| []' fallback was dead
   code). Now properly awaited so [] fallback works when there are no
   footer links.

2. Dockerfile: add HEALTHCHECK pointing at the backend Terminus /health
   endpoint (port 4000). 30s interval, 5s timeout, 30s start period,
   3 retries. Satisfies Trivy DS-0026 and gives Docker/K8s/Compose a
   proper liveness signal.
@keysersoft
keysersoft enabled auto-merge (squash) May 12, 2026 08:50
@keysersoft
keysersoft merged commit 0d05ce8 into main May 12, 2026
11 checks passed
@keysersoft
keysersoft deleted the keysersoft/codeql-easywins branch May 12, 2026 08:52
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.

1 participant