Web Security

Learning outcomes:

  • Describe common website attacks, such as SQL injection and defacing
  • Explain how websites, and the people using them, can be protected from attacks
  • Explain how HTTPS and certificates work, and what happens when a certificate authority is compromised
  • Compare the benefits and risks of single sign-on and VPNs

Would you like to download my PowerPoint to follow along?

  • Hacking a website
    • Injections: SQL, HTML, and JavaScript
    • Leaking data
    • Defacing
    • SQL injection video: Running an SQL Injection Attack (Computerphile)
    • The OWASP Top 10:2025 web application security risks. Broken access control is still number 1, injection is number 5, and software supply chain failures are new at number 3
    • SQL injection still works, MOVEit (2023): the Clop ransomware gang found a SQL injection bug in MOVEit Transfer, software companies use to send files, before anyone else did (a zero day). They stole data from more than 2,600 organizations, affecting almost 84 million people (TechCrunch, CISA)
  • Prompt injection: hacking the AI
    • Injection again, but aimed at AI instead of a database
    • Someone hides instructions in a web page, email, or document. When an AI reads it, the AI may follow those instructions instead of yours
    • Google found real examples on the web: hidden text trying to make AI recommend one business over others, and attempts to delete files. Detections went up 32% from November 2025 to February 2026 (Google)
    • It is number 1 on OWASP's list of risks for AI apps
  • Protecting a website
    • Updating
    • Frameworks
    • Apps and add-ons, such as WordPress plugins
    • Securing pages and uploads
    • Checking inputs and files
  • Client side attacks
    • Sniffing
    • Tracking cookies and supercookies
    • Browser fingerprinting
  • Client side defense
    • Browser settings and privacy mode
    • Incognito isn't invisible
      • Incognito (Chrome) and Private Browsing (Safari, Firefox, Edge) only hide what you do from other people using the same device. When you close the window, it forgets your history, cookies, and anything you typed into forms
      • It does not hide what you do from the websites you visit, especially if you log in, or from whoever runs the network: your school, your job, or your internet provider (Google Chrome Help)
      • Files you download and bookmarks you save stay on the device
      • 2024: Google agreed to delete billions of records it had collected from people browsing in Incognito
    • Tor
    • HTTPS always
    • Blocking cookies and JavaScript
  • HTTPS and certificates
    • What is HTTPS?
    • What is a certificate?
    • Certificate authorities
      • For profit, and non-profit such as Let's Encrypt
      • Authenticating users
      • Trusted certificates
      • When it goes wrong: DigiNotar and Comodo
      • Historical note: DigiNotar and Comodo were both hacked in 2011, and attackers made fake certificates for sites like Google. DigiNotar went out of business. Still worth knowing because they show what happens when a certificate authority is hacked.
      • Revocation
      • Entrust (2024): Chrome stopped trusting its certificates after years of compliance failures (Google Security Blog)
      • Shorter certificate lifetimes: 200 days from March 2026, and 47 days by 2029, so renewals have to be automated (CA/Browser Forum)
  • Single sign-on
    • Reduces password fatigue
    • Reduces IT costs and time spent on authentication
    • "Keys to the castle": one stolen login opens everything
    • Should include two factor authentication
    • Censorship in some countries can block the third party
    • Keys to the castle, Microsoft (2023): China-backed hackers stole a Microsoft signing key, the master key used to prove logins are real. With it, they could make their own logins, and read the email of more than 500 people, including senior US officials. A US review board blamed "a cascade of security failures" at Microsoft (CNN, Cyber Safety Review Board report)
  • VPN
    • What is a VPN?
    • Why would a business want one?
    • What about a consumer?
    • What are the risks of a VPN?
    • What are some less known benefits?

Suggested Activities and Discussion Topics:

  • In class activity: Trick Gandalf. Gandalf is a free game where an AI guards a secret password, and your job is to trick it into telling you. Each level, the AI gets better at saying no. Work alone or in pairs: how far can you get in 15 minutes? Afterward, talk about what tricks worked, and what that means for AI tools that read your email and web pages for you.
  • Discussion: would you use single sign-on for everything? Why or why not?
  • Activity: click the padlock in your browser on a site you use often, and look at its certificate. Who issued it, and when does it expire?
  • Follow the instructions on this PDF (accessible HTML version)

Would you like to see some more classes? View all classes