designwithfocus

Website security

What Is Website Security? HTTPS, Updates and Real Risks

By Design With Focus Team 6 min read
A browser padlock beside an update list and a sealed backup drive

Short answer

Website security is the work of protecting a site and the people who use it from attackers. The practical start is HTTPS, reviewed updates, limited access, and backups you can actually restore. Damage can be to reputation, money, or even physical safety, and it often targets private data or actions that should stay limited to certain users. No single scan score replaces those habits.

Last verified against the sources listed below.

Key takeaways

  • MDN defines web security as protecting sites and users from damage by attackers, who are outside parties with a reason to harm the site.
  • Serve every page and subresource over the secure protocol so the connection is encrypted with TLS.
  • HTTPS uses port 443. Plain HTTP uses port 80. Browsers mark sites without the secure protocol as not secure.
  • The OWASP Top 10 is a consensus list of the most serious web application risks. The current released version is the 2025 edition.
  • Update dependencies on purpose, with a lockfile, and review the change before you accept it.
  • Make regular backups of the site and its data, and stop attackers from reading or editing those copies.

What is website security? MDN’s security overview calls it the practice of protecting websites and their users from damage caused by attackers, meaning malicious third parties. The damage can be reputational, financial, or physical, and it can target private data or actions limited to certain people, for financial, political, or personal motives.

MDN’s first practice is to serve every page and subresource over HTTPS. The SVG Minifier is a small example of the same idea applied to a file: it runs in the browser only, so the SVG is not uploaded to another service to be cleaned. Browser only is how this site marks that tool.

Why does website security matter on an ordinary site?

A site that only publishes pages can still leak data, host a scam, or lose its only copy.

MDN lists guides for cross-site scripting, request forgery, phishing, and manipulator-in-the-middle attacks. A comment form, a login, or a script from somewhere else can be enough. Account access is one of the most valuable targets, because signed-in people can act in ways the public should not. MDN calls threat modeling a structured pass over which attacks match the features you ship, so a brochure and a logged-in app do not share one list.

  • OWASP’s Top 10 project calls the Top 10 the reference standard for the most critical web application risks.
  • The current released version on that page is the 2025 edition.
  • The overview does not list category names, so this guide does not invent them.

Google asks whether pages are served securely. Core Web Vitals feed ranking systems, and other page-experience aspects do not directly raise rankings. Do this work for the people on the site.

What does a certificate do on an HTTPS site?

A certificate is how the browser starts a TLS session and checks it reached the site it asked for. MDN’s HTTPS glossary says HTTPS is encrypted HTTP. TLS encrypts the whole exchange, which matters for banking or shopping. Cloudflare’s HTTPS guide says the protocol was formerly called SSL, and that HTTPS is HTTP sent over TLS.

HTTPS uses port 443, and HTTP uses port 80. The certificate holds the public key, the private key stays on the server, and the two sides run a handshake. Chrome and other browsers mark a site without HTTPS as not secure, and Cloudflare tells readers to look for a padlock. The same guide says that without encryption, anyone on the path can read the packets as plain text.

MDN also says to set a Content Security Policy, to be careful about cross-origin requests, and to use Subresource Integrity for scripts loaded from other servers. Encryption does not fix a script you chose to trust.

How do updates and access control work?

Updates close holes in other people’s code. Access control limits who can ship those updates.

MDN’s operational security guide says projects depend on third-party packages, and suppliers ship security fixes you usually want. Installing every release at once is its own risk. If an attacker publishes a bad version and your build takes it automatically, you are compromised without editing your own code.

MDN’s practical controls are specific:

  • Use a lockfile, commit it, and build from it so versions stay pinned until you change the file.
  • Read the changelog, notice new dependencies, and look at the diff when you can. Consider waiting, because researchers often catch a bad release quickly.
  • Give maintainers only the access they need. Prefer passkeys. If you cannot, use multi-factor login with time-based one-time passwords.
  • Keep secrets out of public repositories, and limit who can read them.

For visitors, MDN says not to use passwords alone. Passkeys come first, and time-based one-time passwords are the fallback it prefers. Session cookies that mark a signed-in visitor should also stay short-lived.

Which controls are worth doing first?

Start with four controls you can explain, then add scans. The table ties each one to a page opened for this guide.

Control What to do Where it comes from
HTTPS Serve pages and subresources over TLS, on port 443, and present a certificate. MDN’s core practices and Cloudflare’s HTTPS guide.
Updates Pin dependency versions with a lockfile and review each update before you accept it. MDN’s operational security guide.
Access Use passkeys or multi-factor login, grant least privilege, and lock down session cookies. MDN’s security overview and operational guide.
Backups Make regular copies of the site and its data, and stop attackers from reading or changing those copies. MDN’s section on making backups.

MDN says backups defend against mistakes, vandalism, and ransomware that locks data until a payment. The copy must stay confidential and intact, and it should live apart from the live site so one break-in cannot rewrite both. None of these rows is a numeric grade.

How do you audit without inventing a score?

An audit is a list of checks, not a single score. MDN says to log failed sign-ins and access failures so a maintainer can respond. Its HTTP Observatory scans whether a site follows certain good practices. Read those findings against the four controls above.

Search Console has a report for whether pages are served securely. That report is about the connection, not your libraries. OWASP asks teams to adopt the Top 10 as a first step. The overview you can cite here does not name the ten categories.

Keep file handling in the same pass:

  • Minify an SVG locally with the SVG tools instead of posting it to a random cleaner.
  • Let web design decide what the page contains, and let security decide who can change it and whether the connection hides it in transit.

Frequently asked questions

Which sign-in methods does MDN rank above a password alone?

MDN's security overview says not to rely on passwords alone when people sign in. Passkeys are the most secure method it names. If you cannot use passkeys, time-based one-time passwords are more secure than a traditional password. The operational guide adds a sharper point for project maintainers: most forms of multi-factor login still fail against phishing, while passkeys are the strongest defense it describes against that attack.

What should a cookie for a signed-in visitor include?

MDN says to limit cookie access. Set the same-site flag to Strict when you can, and to Lax otherwise. Also mark the cookie so scripts cannot read it, and so the browser sends it only on a secure connection. Shorten the lifetime of cookies that represent a signed-in person. Those settings do not replace encryption. They reduce the chance that the cookie is sent in the wrong context or read by a script on the page.

Does a good speed score mean the site is safe?

No. Google's page experience page says Core Web Vitals are used by ranking systems, and that other page-experience aspects do not directly raise rankings. Being served in a secure fashion is one of the questions on that page, next to speed, mobile layout, and ads. A fast page can still be on the plain protocol, and a secure page can still ship an unreviewed dependency. Treat the reports as separate checks.

What kinds of attacks does MDN actually name?

The security overview lists guides for specific attacks, including clickjacking, cross-site request forgery, cross-site scripting, insecure direct object reference, manipulator in the middle, phishing, and server-side request forgery. It also lists subdomain takeover and supply chain attacks. Those are MDN's guide titles, not a vendor ranking and not a count of incidents. Which ones matter depends on what the site lets people do.

How can you track third-party code without guessing?

MDN's operational guide describes a software bill of materials, an inventory of components and external services. It names two common formats, CycloneDX, which started at OWASP, and SPDX, maintained by the Linux Foundation. An inventory can list versions, hashes, and known vulnerabilities. Pair it with a lockfile so the build installs those exact versions. The inventory does not install the updates for you. You still review them.

Sources