Skip to content

fix: security audit — upgrade vulnerable deps and harden API/headers#4

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1781894692-security-fixes
Open

fix: security audit — upgrade vulnerable deps and harden API/headers#4
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1781894692-security-fixes

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

Addresses 18 known vulnerabilities (2 critical, 7 high, 9 moderate) found via npm audit, plus several hardening improvements.

Critical fixes

Dependency upgradesnext 12.0.9 → 16.2.9 eliminates 13+ CVEs:

react/react-dom 17 → 19, typescript 4.5 → 5.8, eslint 8 → 10, all @types/* to latest. Resolves minimist critical prototype pollution and 5 high-severity transitive dep vulns.

Residual: 2 moderate postcss issues — transitive dep of next, unfixable without downgrading.

Hardening

  • API route: pages/api/hello.ts now rejects non-GET requests with 405 Method Not Allowed + Allow header
  • Security headers in next.config.js: X-Content-Type-Options: nosniff, X-Frame-Options: DENY, Referrer-Policy: strict-origin-when-cross-origin
  • poweredByHeader: false — suppresses X-Powered-By: Next.js to reduce fingerprinting surface
  • .gitignore: added root .env and .env*.local catch-all to prevent accidental secret commits
  • handlers/upgrade.go: added missing package declaration and import so the file compiles

Link to Devin session: https://app.devin.ai/sessions/2c5f8758d14541c784bcae3f71c5a5d9
Requested by: @Bautisa46

- Upgrade next 12.0.9 -> 16.2.9 (fixes 13+ CVEs including critical auth bypass, SSRF, DoS)
- Upgrade react/react-dom 17.0.2 -> 19.2.7
- Upgrade eslint, typescript, @types/node, @types/react to latest
- Add HTTP method validation to /api/hello (reject non-GET with 405)
- Add security headers: X-Content-Type-Options, X-Frame-Options, Referrer-Policy
- Disable X-Powered-By header
- Fix handlers/upgrade.go missing package declaration and import
- Harden .gitignore to cover root .env file

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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