Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add security headers, pin AllowedHosts and honor forwarded headers

Open
#50 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
50/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
azure
Domain
backend, security

Research direction

Start with LearnStack/appsettings.json:11 and LearnStack/Program.cs:76-95; review the current request pipeline and App Service deployment settings. Define the production host allowlist and CSP allowances, then verify the requested headers, forwarded scheme and client IP, unexpected-Host rejection, and securityheaders.com grade.

Written by the indexing model from the issue text.

Description

enhancement

Tier 2 — security

Problem
  • No security headers are emitted: no CSP, X-Content-Type-Options, Referrer-Policy or X-Frame-Options.
  • AllowedHosts is "*", so the app answers to any Host header (host-header injection into generated links, cache poisoning).
  • UseForwardedHeaders is not configured even though the app runs behind the App Service reverse proxy, so the scheme and client IP seen by the app are the proxy's — affecting redirects, logging and any future IP-based rate limiting.
Evidence
  • LearnStack/appsettings.json:11 — "AllowedHosts": "*"
  • LearnStack/Program.cs:76-95 — no headers middleware, no UseForwardedHeaders
Proposed fix
  1. Add a middleware emitting the standard header set; start CSP in report-only mode since MudBlazor and Google Fonts need allowances, then enforce.
  2. Pin AllowedHosts to the production domain(s).
  3. UseForwardedHeaders with ForwardedHeaders.XForwardedFor | XForwardedProto early in the pipeline.
Acceptance criteria
  • securityheaders.com grade A or better
  • Requests with an unexpected Host are rejected
  • Logs show real client IPs and the correct scheme
Dominant language
HTML
Stars
10
Forks
0
Avg merge
2h 35m
Merged PRs (30d)
21

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from kasuken/LearnStack

All issues in kasuken/LearnStack

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.