Skip to main content

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.

http://127.0.0.1:5500/index.html

Answer for the page or site you are reviewing. Choose Not applicable when an item does not apply.

Foundations






Third-party code




Frames and embeds





Links




Browser policies





Forms and cookies






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.

How to Run a Review​

Work in this order. It moves from what is quick to check to what takes longer:

  1. List what the page loads. Open DevTools, then Network, reload, and note every host. Anything you cannot explain needs an answer.
  2. Read the response headers. Click the page request, and read Response Headers. The Header Reviewer tab helps you read them.
  3. Check the Console. Look for mixed content messages, CSP violations, and blocked frames.
  4. Search the markup and scripts. Look for http://, target="_blank", window.open, innerHTML, document.write, formaction, rel="opener", autocomplete="off", and method="get" near sensitive fields.
  5. Test the forms. Submit one with test values and check the request in Network: method, address, and body.
  6. 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.
  7. 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:

GroupWhat it checksLessons
Foundationshttps, no secrets in URLs, escaping, safe DOM methods, link schemes, sanitisingSecurity Basics, XSS Basics, Mixed Content
Third-party codeA list of what you load, trusted hosts, integrity, graceful failureSecurity Basics, Mixed Content
Frames and embedssandbox, allow, referrerpolicy, frame-ancestors, postMessageiFrame Security, Sandbox Attribute
Linksnoopener, noreferrer, user-posted linksnoopener, noreferrer
Browser policiesCSP, mixed content, HSTSContent Security Policy, Mixed Content
Forms and cookiesPOST, https, autocomplete, CSRF tokens, cookie flags, extra headersSecure 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:

HeaderWhat it doesWhere it was covered
Content-Security-PolicyLimits where scripts, styles, frames, and forms may come from or go toContent Security Policy
Strict-Transport-SecurityMakes browsers always use https for your siteMixed Content
X-Content-Type-Options: nosniffStops browsers from guessing a file's type, so an uploaded text file cannot be run as a scriptHTML Security Basics
Referrer-PolicyControls how much of your address other sites receivenoreferrer
Permissions-PolicyTurns off browser features, such as the camera, that you do not useiFrame Security
Cross-Origin-Opener-PolicyCuts opener links between pages of different originsnoopener
Set-Cookie flagsHttpOnly, Secure and SameSite limit how cookies can be read and sentHTML 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:

PriorityExamples
Fix nowSecrets 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 soonNo 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.
Improvenoopener 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.txt tells researchers how to contact you:
/.well-known/security.txt
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​

  1. Run the same checklist every time, and keep the answers.
  2. Fix high-risk items first.
  3. Prefer headers for protections that support them.
  4. Keep a list of third-party hosts, and prune it.
  5. Layer defences: escaping, CSP, sandbox, cookie flags, and server checks.
  6. Re-run after changes, not only after incidents.
  7. Teach the team to read the Console and Network panel.
  8. 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​

  1. Running a review once, and never again.
  2. Treating the checklist as a certificate.
  3. Fixing the easy items and leaving the high-risk ones.
  4. Adding a header without testing it, then breaking the site.
  5. Relying on one layer, such as only a CSP.
  6. Trusting third parties forever.
  7. Sharing captures that contain real session values.
  8. Skipping the server side, because the page looks fine.
  9. Testing sites you do not own.
  10. Never writing results down.

Practice Time​

  1. Open the Interactive Checklist, and answer it for one real page of yours. What is your score? Which items are still open?
  2. Open the "No" list, and pick the one you would fix first. Why?
  3. In the Header Reviewer, load the weak headers. Which problems does it find? Fix them one by one.
  4. Open DevTools on your own page, copy its response headers, and paste them (without cookies) into the Header Reviewer.
  5. Run through the review steps above on a small page you own, and write a short report.
  6. Add one header or markup fix, then check the Console for surprises.
  7. Write a security.txt for a project of yours.
  8. 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.