Skip to content

nsc-events-fullstack_32_184-add-helmet#186

Open
NahomAlemu wants to merge 1 commit intomainfrom
184-add-helmet
Open

nsc-events-fullstack_32_184-add-helmet#186
NahomAlemu wants to merge 1 commit intomainfrom
184-add-helmet

Conversation

@NahomAlemu
Copy link
Copy Markdown
Contributor

Summary & Changes 📃

  • Resolves: Issue: Missing HTTP Security Headers (Helmet) #184

  • Summary: Add Helmet middleware to secure HTTP response headers

    • 🔨 Fixes missing security headers that left the backend
      vulnerable to common web attacks (clickjacking, MIME-sniffing,
      XSS, etc.)
      • 👀 All API responses now include security headers:
        X-Content-Type-Options, X-Frame-Options,
        Strict-Transport-Security, X-XSS-Protection,
        Content-Security-Policy, and more
      • 🗨️ Helmet is applied as the first middleware before
        CORS/routing to ensure all responses are protected
    • Changes:
      • ✅ Installed helmet package
      • ✅ Added import helmet from 'helmet' in main.ts
      • ✅ Added app.use(helmet()) middleware
      • 🛠️ No breaking changes
      • 📝 Uses helmet defaults which are secure for most
        applications

    How to Test 🧪

    1. Steps to Reproduce:
    • Step 1: Start the server with npm run start
    • Step 2: Make any API request (e.g., curl -I http://localhost:3000/api)
    • Step 3: Inspect response headers
    1. Expected Behavior: Response includes security headers like
      X-Content-Type-Options: nosniff, X-Frame-Options: SAMEORIGIN,
      Strict-Transport-Security, etc.
    2. Actual Behavior (if bug): Previously, these headers were
      missing from all responses

Checklist ✅

  • I have tested this PR locally and it works as expected.
  • This PR resolves an issue (Resolves #issue-number).
  • Reviewers, assignees(self), tags, and labels are correctly assigned.
  • Squash commits and enable auto-merge if approved.

@NahomAlemu NahomAlemu self-assigned this Mar 14, 2026
@NahomAlemu NahomAlemu added the security Vulnerability patches, encryption, or access control label Mar 14, 2026
@NahomAlemu NahomAlemu linked an issue Mar 14, 2026 that may be closed by this pull request
1 task
@github-actions
Copy link
Copy Markdown

🚀 E2E Smoke Test Results

Running smoke tests only (non-critical files changed)

Status Count
✅ Passed 5
❌ Failed 0
📊 Total 5

View detailed report

💡 To run full E2E suite, add [e2e-full] to your commit message or trigger manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security Vulnerability patches, encryption, or access control

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue: Missing HTTP Security Headers (Helmet)

1 participant