Skip to main content

26 docs tagged with "security"

View all tags

Content Security Policy (CSP)

Learn how a Content Security Policy tells the browser which sources of scripts, styles, images, frames and forms to trust. Covers directives, source values, nonces, report-only rollout, and the meta tag's limits, with a live policy tester and a directive matcher.

HTML Embed Element

Learn the HTML embed element: what it was built for, how src, type, width and height work, why it has no fallback content, how it compares with object, iframe and img, accessibility and security limits, and when to choose something else, with live demos.

HTML Embedded Content

Start learning HTML embedded content: iframe, embed, object, SVG, canvas, and maps. See what each element is for, how they differ, how to choose between them, and why third-party content needs security care, with a live sampler of four embedding methods.

HTML Form Action Attribute

Learn the HTML form action attribute: where a form sends its data, absolute and relative URLs, what happens when action is left out, the GET query string trap, formaction on buttons, the target attribute, third-party form services, mailto actions, progressive enhancement with fetch, and security notes on HTTPS, CSRF, and the Content-Security-Policy form-action rule.

HTML Form Methods: GET and POST

Learn the HTML form method attribute: how GET puts data in the URL and POST sends it in the request body, when to use each one, URL encoding, the post-redirect-get pattern, method dialog, why HTML forms cannot send PUT or DELETE, CSRF and privacy notes, and how to choose the safe method for search, login, and checkout forms.

HTML Iframe Element

Learn the HTML iframe element: embedding another page with src and srcdoc, titles for accessibility, size and aspect-ratio, lazy loading, the sandbox attribute, allow and referrerpolicy, why some sites refuse to be framed, and talking to a frame with postMessage, with live demos.

HTML Input Type File

Learn the HTML input type file: uploading one or many files, the accept, multiple, capture, and required attributes, why a form needs method=post and enctype=multipart/form-data, reading file name, size, and type with JavaScript, image previews, size checks, styling the button, and safe server-side handling on CodeHarborHub.

HTML Input Type Hidden

Learn the HTML input type hidden: sending values the visitor does not see, such as record ids, CSRF tokens, return pages, and multi-step state. Understand why hidden is not secret, why the server must never trust it, how it differs from the hidden attribute, disabled, and readonly, and common mistakes on CodeHarborHub.

HTML Input Type Password

Learn the HTML input type password: how it masks characters, what it does not protect, the autocomplete values current-password and new-password, a show-password toggle that is accessible, minlength and pattern rules, password managers, HTTPS, and common security mistakes on CodeHarborHub.

HTML Input Type URL

Learn the HTML input type url for web addresses: what counts as a valid URL, why a scheme like https:// is required, restricting to http and https with pattern, autocomplete, trimming, the javascript: danger, safe ways to display user links, and common mistakes on CodeHarborHub.

HTML Link Security

Learn how to keep HTML links safe. Understand reverse tabnabbing, rel noopener and noreferrer, referrer policy, dangerous javascript and data URLs, user-submitted links, look-alike addresses, HTTPS, and how to protect your visitors on CodeHarborHub.

HTML Multipart Form Data (enctype)

Learn the HTML form enctype attribute: application/x-www-form-urlencoded, multipart/form-data, and text/plain, why file uploads need multipart, what a multipart request body looks like, using FormData with fetch without setting the Content-Type, formenctype on buttons, and safe server-side handling of uploaded files, size limits, and filenames.

HTML Security Basics

Learn the foundations of HTML security: what an origin is, what the same-origin policy protects, how to find the doors into your page, and why https and server-side checks matter. Includes an origin comparison lab and a page survey tool.

HTML Security Checklist

A practical, step-by-step security review for any web page: 24 checks grouped by topic, a response header reviewer, fix priorities, and what a checklist cannot cover. Includes an interactive checklist that builds your to-do list.

HTML Security: Keeping Pages and Visitors Safe

Start learning HTML security: where web page risks come from, which HTML features protect visitors (escaping, rel noopener and noreferrer, iframe sandbox, CSP, https), and which protections live on the server. Includes an escaping lab and a defence matcher.

iFrame Security

Learn the two sides of iframe security: embedding other pages safely (trust, sandbox, allow, referrer policy, frame-src) and stopping others from embedding yours (clickjacking, frame-ancestors). Includes a clickjacking lab, a postMessage origin lab, and an embed checker.

Mixed Content

Learn what mixed content is, why an https page that loads anything over http is unsafe, how browsers treat active and passive content, and how to fix it with https URLs, upgrade-insecure-requests and HSTS. Includes a mixed content lab and a markup finder.

noopener and Reverse Tabnabbing

Learn how window.opener lets a page you open reach back into yours, what reverse tabnabbing is, how rel=noopener and the Cross-Origin-Opener-Policy header close the door, and where browsers already help. Includes an opener lab and a link scanner.

noreferrer and Referrer Policy

Learn what the Referer header tells other sites, how rel=noreferrer, the referrerpolicy attribute, the meta tag and the Referrer-Policy header control it, and why secrets must never live in URLs. Includes a referrer lab and a policy picker.

Secure Forms

Learn the HTML side of secure forms: choosing POST over GET, https actions, password and autocomplete attributes, hidden fields, formaction pitfalls, the form-action CSP directive, and what HTML can never protect. Includes a submit lab, a form auditor and an autocomplete matcher.

Secure HTML Form Design

Learn secure HTML form design: never trusting the browser, server-side validation with allow-lists, HTTPS, escaping output to stop XSS, parameterised queries against SQL injection, CSRF tokens and SameSite cookies, safe password handling, rate limiting and bot defences, avoiding information leaks, safe file uploads, mass assignment, privacy and data minimisation, and a practical security checklist.

The HTML Base Element

Learn the HTML base element: how it changes the starting address of every relative link, image and form, how it affects fragment links like #top, how base target works, why it is risky, and what to use instead. Includes a live URL resolver and a base tag checker.

The HTML Script Element

Learn the HTML script element: inline and external scripts, defer, async and type module, where to place scripts, data blocks like JSON-LD, noscript fallbacks, and how to load JavaScript safely. Includes a live loading-order experiment, a script tag checker, and a JSON data block demo.

The sandbox Attribute

Learn how the iframe sandbox attribute works: start with every power removed, add back only what an embed needs, and avoid the allow-scripts plus allow-same-origin trap. Includes a permission lab and a scenario picker.

Third-Party Content Security

Learn how to keep a page safe when it embeds content you did not write: the risks of scripts, iframes and widgets, Content-Security-Policy, Subresource Integrity, iframe sandbox, Permissions-Policy, referrer and link rules, consent and privacy, click-to-load, auditing, and incident planning, with live demos.

XSS Basics: Cross-Site Scripting

Learn what cross-site scripting (XSS) is, the three types, why it happens, and how to prevent it: escape output for the right context, use safe DOM methods, validate links, sanitise when HTML is allowed, and add a CSP. Includes a context escaping lab and a safe-or-unsafe quiz.