HTML Security Checklist
You have now covered the ten lessons of this section, from origins and XSS to frames, links, policies, mixed content, and forms. This final lesson pulls them into one practical review that you can run on any page, and keep running as the page changes.
A checklist cannot make a site safe. What it does is stop you from forgetting the basics, and give a team one shared list to work from.
What You Will Learnβ
- How to run a security review in a sensible order
- A 24-point checklist, grouped by topic
- How to read your response headers
- How to decide what to fix first
- What a front-end checklist does not cover
- How to keep the review going
The Big Ideaβ
Security problems rarely come from one big mistake. They come from many small gaps: one forgotten rel, one old http://, one script nobody remembers adding. A review that checks the same things every time catches those gaps before attackers do.
- Interactive Checklist
- Header Reviewer
- The Essentials
Answer for the page or site you are reviewing. Choose Not applicable when an item does not apply.
No score yet.
0 not applicable, 24 not answered.
Nothing you choose is saved or sent anywhere. The score is a rough guide to what is left to review, not a certificate of safety.
- Problem: Content-Security-Policy: 'unsafe-inline' in the script rules lets injected inline scripts run.
- Problem: Content-Security-Policy: default-src * lets everything else load from anywhere.
- Tip: Content-Security-Policy: no frame-ancestors (and no X-Frame-Options), so any site may frame your pages.
- Tip: Content-Security-Policy: add object-src 'none'.
- Tip: Content-Security-Policy: add base-uri 'self'.
- Tip: Content-Security-Policy: add form-action. It is not covered by default-src.
- Tip: Strict-Transport-Security: missing. Add it once your whole site works over https, starting with a short max-age.
- Tip: X-Content-Type-Options: missing. Send nosniff.
- Problem: Referrer-Policy: unsafe-url sends the full address to every site, even over http.
- Tip: Permissions-Policy: missing. Turn off features your pages do not use.
- Problem: Set-Cookie sessionid: no HttpOnly, so page scripts can read it.
- Problem: Set-Cookie sessionid: no Secure, so it can be sent over http.
- Tip: Set-Cookie sessionid: no SameSite value.
- Tip: X-Powered-By: tells everyone which software you run. Remove it if you can.
A teaching checker for the common headers. Nothing is requested from any server. Copy real headers from the Network panel, or from curl -I, and remove anything private first.
Content-Security-Policy: default-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'self'
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: camera=(), microphone=(), geolocation=()
Set-Cookie: sessionid=...; Path=/; Secure; HttpOnly; SameSite=Lax
<a href="https://partner.example.net/" target="_blank" rel="noopener noreferrer">Partner</a>
<iframe src="https://widgets.example.net/map" title="Map"
sandbox="allow-scripts" referrerpolicy="strict-origin-when-cross-origin"></iframe>
<form action="/login" method="post">
<input type="hidden" name="csrf_token" value="SERVER_GENERATED_VALUE">
<input type="password" name="password" autocomplete="current-password">
</form>
How to Run a Reviewβ
Work in this order. It moves from what is quick to check to what takes longer:
- List what the page loads. Open DevTools, then Network, reload, and note every host. Anything you cannot explain needs an answer.
- Read the response headers. Click the page request, and read Response Headers. The Header Reviewer tab helps you read them.
- Check the Console. Look for mixed content messages, CSP violations, and blocked frames.
- Search the markup and scripts. Look for
http://,target="_blank",window.open,innerHTML,document.write,formaction,rel="opener",autocomplete="off", andmethod="get"near sensitive fields. - Test the forms. Submit one with test values and check the request in Network: method, address, and body.
- Try to break your own input. Enter harmless test text with angle brackets and quotes, and see how each place on the page displays it. Test only your own site, or one you have permission to test.
- Write down what you find, and fix it in priority order.
Use the Interactive Checklist tab as you go. It builds a to-do list from your "No" answers, with a link back to the lesson that explains each fix.
The Checklist in Briefβ
The 24 items in the tool are grouped like this:
| Group | What it checks | Lessons |
|---|---|---|
| Foundations | https, no secrets in URLs, escaping, safe DOM methods, link schemes, sanitising | Security Basics, XSS Basics, Mixed Content |
| Third-party code | A list of what you load, trusted hosts, integrity, graceful failure | Security Basics, Mixed Content |
| Frames and embeds | sandbox, allow, referrerpolicy, frame-ancestors, postMessage | iFrame Security, Sandbox Attribute |
| Links | noopener, noreferrer, user-posted links | noopener, noreferrer |
| Browser policies | CSP, mixed content, HSTS | Content Security Policy, Mixed Content |
| Forms and cookies | POST, https, autocomplete, CSRF tokens, cookie flags, extra headers | Secure Forms |
Reading Your Headersβ
Most of the strongest protections are response headers, which you set on your server or hosting service, not in HTML. A quick guide:
| Header | What it does | Where it was covered |
|---|---|---|
Content-Security-Policy | Limits where scripts, styles, frames, and forms may come from or go to | Content Security Policy |
Strict-Transport-Security | Makes browsers always use https for your site | Mixed Content |
X-Content-Type-Options: nosniff | Stops browsers from guessing a file's type, so an uploaded text file cannot be run as a script | HTML Security Basics |
Referrer-Policy | Controls how much of your address other sites receive | noreferrer |
Permissions-Policy | Turns off browser features, such as the camera, that you do not use | iFrame Security |
Cross-Origin-Opener-Policy | Cuts opener links between pages of different origins | noopener |
Set-Cookie flags | HttpOnly, Secure and SameSite limit how cookies can be read and sent | HTML Security Basics |
If you cannot change headers (for example, on a basic static host), look for a headers or settings feature on your platform. If there is none, the meta tag works for some policies, but with real limits, as the CSP lesson explains.
What to Fix Firstβ
Not every gap is equally urgent. A rough order:
| Priority | Examples |
|---|---|
| Fix now | Secrets or personal data in URLs. Untrusted data written with innerHTML. Scripts or forms over http. Sensitive forms using GET. A user-supplied iframe address. |
| Fix soon | No CSP at all, or one with 'unsafe-inline' for scripts. Missing sandbox on third-party frames. Session cookies without HttpOnly, Secure, or SameSite. No frame-ancestors on pages with sensitive actions. |
| Improve | noopener and noreferrer on every outbound link. integrity on third-party files. Permissions-Policy. A reviewed list of third-party hosts. HSTS with a long max-age. |
Your own situation may change the order. A site with no login and no user content has fewer high-risk items than one that stores accounts.
What This Checklist Does Not Coverβ
This section is about the HTML and browser side of security. Real protection also needs things a front-end checklist cannot see:
- Server code, such as SQL injection, file upload handling, and access control. See Secure Form Design for an introduction.
- Login design, such as password storage, rate limiting, and multi-factor sign-in.
- Dependencies, meaning the libraries and packages you use. Run your package manager's audit command, and keep them updated.
- Infrastructure, such as servers, certificates, backups, and who can access what.
- People and process, such as who can publish, how you respond to a report, and what the law requires where you operate.
If you handle payments, health data, or other sensitive information, get proper security help and read the rules that apply to you. A learning checklist is not an audit.
Keep the Review Goingβ
- Review after every change that adds a script, an embed, a form, or a new third-party service.
- Schedule a regular review, such as once a quarter, and compare with the last one.
- Automate what you can. Many teams add header checks or markup checks to their build process, so a regression shows up before it ships. Check what your tools support.
- Monitor. CSP reports, console errors, and unusual traffic are early signs.
- Make it easy to report problems. A small file at
/.well-known/security.txttells researchers how to contact you:
Contact: mailto:security@example.com
Expires: 2027-12-31T23:59:59Z
Preferred-Languages: en
Replace the address and date with real ones, and check the current format specification before you publish it.
Practise Responsiblyβ
- Only test sites you own, or have written permission to test.
- Use made-up data in test forms. Never use real passwords or card numbers.
- If you find a problem on someone else's site, do not poke further. Look for their security contact, and report it politely.
- Do not share screenshots of headers or cookies that contain real session values.
Best Practicesβ
- Run the same checklist every time, and keep the answers.
- Fix high-risk items first.
- Prefer headers for protections that support them.
- Keep a list of third-party hosts, and prune it.
- Layer defences: escaping, CSP, sandbox, cookie flags, and server checks.
- Re-run after changes, not only after incidents.
- Teach the team to read the Console and Network panel.
- Be honest about what is not covered.
Quick Checklistβ
- I listed everything the page loads
- I read the response headers, and each one is intentional
- The Console shows no mixed content or CSP surprises
- I searched the markup and scripts for the risky patterns
- I tested forms with made-up data
- I wrote down each gap and its priority
- I scheduled the next review
Security and Privacy Notesβ
- Reviewing can expose data. Network captures and header copies may contain cookies, tokens, and addresses. Remove them before sharing.
- A checklist is a snapshot. A page that passes today can fail after the next deployment.
- Third parties change. A host you trusted last year can be sold, hacked, or changed. Review them on a schedule.
- Privacy is part of security. Collecting less data gives attackers less to find, and gives you less to protect.
Global Audience Notesβ
- Rules about data and security differ by country. Check the ones that apply to you and your visitors.
- Documentation and error messages are mostly in English. Make sure your whole team can read the Console, and write your own visitor-facing messages in your visitors' languages.
- Teams are often distributed, so a written, shared checklist beats memory and chat messages.
- Test on the devices and networks your visitors use, because older browsers and weak connections change what works.
Common Mistakes to Avoidβ
- Running a review once, and never again.
- Treating the checklist as a certificate.
- Fixing the easy items and leaving the high-risk ones.
- Adding a header without testing it, then breaking the site.
- Relying on one layer, such as only a CSP.
- Trusting third parties forever.
- Sharing captures that contain real session values.
- Skipping the server side, because the page looks fine.
- Testing sites you do not own.
- Never writing results down.
Practice Timeβ
- Open the Interactive Checklist, and answer it for one real page of yours. What is your score? Which items are still open?
- Open the "No" list, and pick the one you would fix first. Why?
- In the Header Reviewer, load the weak headers. Which problems does it find? Fix them one by one.
- Open DevTools on your own page, copy its response headers, and paste them (without cookies) into the Header Reviewer.
- Run through the review steps above on a small page you own, and write a short report.
- Add one header or markup fix, then check the Console for surprises.
- Write a
security.txtfor a project of yours. - Bonus: schedule a quarterly review in your calendar, and write the checklist link in the invite.
Quick Recapβ
Click a question to check your answer.
1. Why use a checklist?
Most security gaps are small things that get forgotten. A checklist checks the same things every time, and gives a team a shared list.
2. What should you fix first?
High-risk items: secrets in URLs, untrusted data written as HTML, scripts or forms over http, sensitive forms using GET, and user-supplied frame addresses.
3. Which protections are mainly headers?
CSP (including frame-ancestors and form-action), HSTS, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, Cross-Origin-Opener-Policy, and cookie flags.
4. What does a front-end checklist not cover?
Server code, login design, dependencies, infrastructure, and people and process.
5. How often should you review?
After every change that adds a script, embed, form, or third-party service, and on a regular schedule such as quarterly.
6. Who may you test?
Only sites you own, or have written permission to test. Use made-up data in test forms.
Key Takeawaysβ
- Security is many small checks, repeated. A checklist makes that easy.
- Work in order: list what loads, read headers, check the Console, search markup, test forms.
- Fix high-risk items first, and layer your defences.
- Many protections are headers, which you set on the server.
- Know the limits. HTML security is one part of a bigger picture.
- Review again after every change, and keep the answers.
You have finished the security section. To revisit any topic, start from the Security Overview, or go straight to the lesson linked from any item on your to-do list.