Web config reviewHackBlue

Security headers grader

Edit a real-looking HTTP response until it scores an A: HSTS, CSP, framing, cookies, CORS, and the version banners an attacker reads first.

  • Interactive lab
  • Beginner
  • 5 graded steps
  • 0 of 5 solved

Your goal

Your goalEdit one web response until all ten header checks pass, and understand what each fix protects.

This is the response from the account page of an internal Express app behind nginx, captured with curl -sI. It was deployed with framework defaults and a few headers copied from an old blog post.

Edit the headers in place. Every change is graded as you type against ten checks. The grade here is the lab’s own scale: A when every check passes, one letter lower for each failure.

What’s on screen
Response headers
the editable box on the left with the raw response. Restore original puts it back.
Grade
the bar on the right with the letter and how many checks pass.
Checks
the list under the grade. Each check says pass or fail with a note on what is wrong.
Walkthrough
the numbered path beside the workbench (below it on a phone). Each step says what to do and what you should see. Hints open one at a time.
Words to know
HTTP
Hypertext Transfer Protocol, how browsers and web servers talk
HSTS
HTTP Strict Transport Security, which tells browsers to use HTTPS only
CSP
Content Security Policy, which tells browsers what scripts may run
CORS
cross-origin resource sharing, the browser rule for which sites may read an API
HTTPS
HTTP protected with TLS encryption
XSS
cross-site scripting, getting a page to run someone else’s script
Response headers
GradeF · 0 of 10 pass
  • fail
    Strict-Transport-Securitymax-age=300 is under one year (31536000).
  • fail
    Content-Security-Policy script sourcesscript sources include 'unsafe-inline'.
  • fail
    Clickjacking protectionAdd CSP frame-ancestors 'none' (or 'self').
  • fail
    X-Content-Type-OptionsSet nosniff so browsers do not guess content types.
  • fail
    Referrer-PolicyMissing. Set strict-origin-when-cross-origin or stricter.
  • fail
    Permissions-PolicyMissing. Turn off features the site does not use, such as camera=(), microphone=(), geolocation=().
  • fail
    Session cookie attributessid is missing secure, SameSite=Lax or Strict.
  • fail
    CORS on this responseA wildcard origin with credentials is invalid and signals a misconfigured CORS layer. Drop both, or list exact origins.
  • fail
    Version disclosureX-Powered-By: Express 4.17.1. Remove it.
  • fail
    Legacy X-XSS-ProtectionThe old browser XSS filter is gone, and where it existed it could be abused. Remove the header or set it to 0.

The whole walkthrough

Every step in order: 291 words, about 2 min. It gives away every answer, so try the steps first.