Skip to content

fix(security): resolve real CodeQL findings + upgrade vulnerable frontend deps#12

Merged
Harsh-2002 merged 1 commit into
mainfrom
dev
Jun 4, 2026
Merged

fix(security): resolve real CodeQL findings + upgrade vulnerable frontend deps#12
Harsh-2002 merged 1 commit into
mainfrom
dev

Conversation

@Harsh-2002

Copy link
Copy Markdown
Owner

Summary

Resolves the GitHub CodeQL + Dependabot findings. Every alert was triaged against the actual code; this PR fixes the genuine ones, hardens one, and upgrades vulnerable frontend deps. The verified false-positives / by-design alerts are intentionally left as code and will be dismissed with documented reasons (see below).

Real fixes

  • path-injection (functions.go rollback + builder/activate.go): code_hash from the request body flowed into a versions/<hash> filesystem path. Now validated as a 64-char lowercase-hex sha256 (its only legitimate shape) before use, with a defensive re-check in ActivateVersion. + activate_test.go.
  • zipslip (builder.go extractTarGz): added the joined-path-under-destDir guard the backup extractor already uses (defense-in-depth for deploy tarballs).
  • biased-random (Onboarding.vue): replaced crypto % n in the password generator + Fisher–Yates shuffle with unbiased rejection sampling.
  • CI hygiene: least-privilege permissions: contents: read added to cli-e2e/e2e/install-e2e workflows → clears 10 actions/missing-workflow-permissions.
  • deps: axios 1.15 → 1.17 + npm audit fix (follow-redirects, postcss) → npm audit reports 0. Supersedes Dependabot PR chore(deps): bump axios from 1.15.0 to 1.16.0 in /frontend #11.

Dismiss-as-noise (no code change — done post-merge with reasons)

backup.go zipslip + path-injection (extractor sanitizes), kv.go alloc (limit clamped ≤1000), API-key SHA256 ×2 (256-bit random token; correct), OAuth redirect ×2 (redirect_uri validated), logout cookie Secure (deletion cookie; issuers set it conditionally).

Validation

  • go build/vet/test -race green (+ new activate_test.go for the hash guard).
  • npm audit = 0; npm run build + make embed.
  • Expected: after merge, CodeQL re-scan auto-closes the path-injection/zipslip/biased + workflow-permission alerts; Dependabot closes axios/follow-redirects/postcss.

No release — main stays ready.

…tend deps

Triaged all CodeQL + Dependabot alerts against the code; fixes the genuine ones,
hardens one, and upgrades vulnerable deps. (Verified false-positives — backup
extractor, kv alloc clamp, API-key SHA256, OAuth redirect_uri validation, logout
deletion cookie — are left as-is and will be dismissed with reasons.)

- path-injection (functions.go rollback, builder/activate.go): code_hash from the
  request body flowed into a versions/<hash> filesystem path. Validate it is a
  64-char lowercase-hex sha256 (its only legitimate shape) before use; defensive
  re-check in ActivateVersion. + builder/activate_test.go.
- zipslip (builder.go extractTarGz): add the joined-path-under-destDir guard the
  backup extractor already uses (defense-in-depth; deploy tarballs).
- biased-random (Onboarding.vue): replace `crypto % n` in the password generator
  + Fisher-Yates shuffle with unbiased rejection sampling.
- CI: add least-privilege `permissions: contents: read` to cli-e2e/e2e/install-e2e
  workflows (clears 10 actions/missing-workflow-permissions).
- deps: bump axios 1.15→1.17 + npm audit fix (follow-redirects, postcss);
  `npm audit` now reports 0 vulnerabilities. Supersedes Dependabot PR #11.

go build/vet/test green; npm audit 0; ui rebuilt + re-embedded.
@Harsh-2002 Harsh-2002 merged commit f90e58c into main Jun 4, 2026
19 of 25 checks passed
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