pk.org: Computer Security/Lecture Notes

Web Security

Terms we covered

Paul Krzyzanowski – 2026-11-22

The Browser as a Platform

These terms describe the browser’s application environment:

Document Object Model (DOM)
The browser’s internal representation of a page’s structure.
WebAssembly (Wasm)
A portable binary format for running compiled code in browsers.
HTTPS
HTTP carried over an encrypted and authenticated TLS connection.
Mixed content
Content fetched over HTTP by a page served over HTTPS.

The Same-Origin Policy

These terms describe how browsers isolate content from different sites:

Frame
A region of a browser window that renders one document.
iframe
An inline frame that embeds one page inside another.
Origin
The combination of a URL’s scheme, hostname, and port.
Same-origin policy
Preventing a page’s scripts from reading another origin’s data without permission.
Passive content
Non-executable content, such as images and stylesheets, with no authority.
Cross-Origin Resource Sharing (CORS)
Letting a server allow scripts from specified origins to read its responses.
MIME sniffing
Guessing a resource’s type from its bytes, not its declared type.

Cookies

These terms describe cookies and the attributes that protect them:

Cookie
A name-value pair that a server sets and the browser returns.
Session ID
An unpredictable value that identifies a logged-in user’s session.
Authentication cookie
A cookie holding the session ID of a logged-in user.
Session cookie
A cookie without an expiration date, tied to a browsing session.
Persistent cookie
A cookie with an expiration date that survives browser restarts.
Cookie scope
The domain and path that determine where a cookie is sent.
HttpOnly
A cookie attribute that hides the cookie from page scripts.
Secure
A cookie attribute that restricts the cookie to HTTPS connections.
SameSite
A cookie attribute controlling whether cookies accompany cross-site requests.
Site
A scheme and registrable domain, including all of its subdomains.
First-party cookie
A cookie belonging to the site shown in the address bar.
Third-party cookie
A cookie belonging to another site whose content a page loads.
Tracking cookie
A cookie with a unique identifier used to link a browser’s visits.

Cross-Site Scripting

These terms describe script injection attacks and their defenses:

Cross-site scripting (XSS)
Running an attacker’s script inside a legitimate site’s page.
Reflected XSS
XSS in which the server echoes a script from the request.
Stored XSS (persistent XSS)
XSS in which the script is saved on the server.
DOM-based XSS
XSS in which the page’s own script inserts untrusted data as HTML.
Output encoding
Escaping special characters so the browser displays data as text.
Sanitization
Removing dangerous markup from user-supplied HTML.
Content Security Policy (CSP)
A site’s rules restricting which scripts and content its pages may load or run.

Forged Requests and Access Control

These terms describe attacks on a server’s trust in the requests it receives:

Cross-site request forgery (CSRF)
Making a victim’s browser send an unwanted authenticated request.
Anti-CSRF token
An unpredictable value that a server requires with state-changing requests.
Broken access control
A server’s failure to enforce authorization on requests.

Clickjacking and Deception

These terms describe attacks that deceive the user:

Clickjacking
Overlaying an invisible frame so clicks land on hidden controls.
Homograph attack (homoglyph attack)
Deceiving users with domain names built from lookalike characters.
Internationalized domain name (IDN)
A domain name that contains Unicode characters.
Punycode
An ASCII encoding of internationalized domain names.

Tracking

These terms describe how sites follow users across the web:

Tracking pixel (web beacon)
An invisible one-pixel image whose loading sends a request to a tracker.
Cross-site tracking
Linking one browser’s activity across multiple websites.
Retargeting
Showing ads based on products a user viewed on other sites.