Skip to main content

11 docs tagged with "security"

View all tags

Authentication and authorization — proving identity and granting access

This chapter explains the difference between authentication and authorization from the angles of ordering, status codes for failure, and where implementation lives. It covers the three authentication factors, how to carry authentication state via sessions vs. tokens, authorization models like RBAC, and how to structure a written answer.

Browser storage — what changes depending on where you put it

This chapter compares localStorage, sessionStorage, and cookies across five axes — whether they reach the server, what separates them, how long they last, how the size limit applies, and whether tabs share them. It covers why the capacity numbers run in opposite directions as floors and ceilings, and where to put authentication tokens.

Character encoding — how characters map to bytes

This chapter starts from the difference between character set and encoding scheme. It covers four ways of counting characters, normalization for same-looking-different-bytes, collation deciding sort order and comparison, byte-based storage limits, and vulnerabilities from interpretation boundaries being multiple.

Common web attacks and defenses

This chapter organizes major web application attacks — XSS, CSRF, SQL injection — from "conditions that let each succeed" and derives defenses by breaking those conditions. It covers the difference between escaping and placeholders, the relationship between CSRF tokens and SameSite, and why access-control failures rank

Cookies — who, when, and where they get sent automatically

This chapter organizes cookie attributes by "where to send", "how long to keep", and "who can read", and explains the incidents that arise from the scope not matching origin. It covers that Domain widens into subdomains and that SameSite is evaluated at the site level.

Origins and CORS — what the browser draws its lines around

This chapter defines an origin as the triple of scheme, host, and port, and explains that the same-origin policy blocks reading, not sending. It covers when preflight is triggered, why wildcard and credentials can't be combined, and why Vary is needed.

TLS and certificates — what you are trusting when you encrypt

This chapter explains that among the three properties TLS guarantees, what the certificate covers is the other side's identity. It covers certificate chain verification, that intermediate certificate delivery is the server's responsibility, what changes with the location of TLS termination, and reading certificate errors.