Saltar al contenido ForoHackers

Web security: start here

Seguridad web
#3265 · · Citar · Denunciar

Web security protects sites and web applications, and the people who use them, from abuse. A browser runs code from many origins at once and a server answers anyone on the internet, so the rules about who may read what, and who may act as whom, are the heart of the field.

Key concepts

  • Same-origin policy: the browser's basic wall; scripts from one origin cannot freely read another's data.
  • Injection: untrusted input reaching an interpreter, such as SQL or HTML, as code; the cure is parameters and context-aware encoding.
  • Sessions and cookies: how a server remembers a user; flags like HttpOnly, Secure and SameSite limit their exposure.
  • Request forgery: a page that makes the browser send a request the user never intended; tokens and SameSite cookies defend.
  • Transport and headers: HTTPS everywhere, plus headers such as Content-Security-Policy that tell the browser what is allowed.

Vocabulary

  • XSS: cross-site scripting, attacker-controlled script running in a victim's page.
  • CSRF: cross-site request forgery.
  • CORS: the mechanism that lets a server relax the same-origin policy for chosen origins.
  • TLS: the protocol that encrypts and authenticates the connection.

What to study, in order

  1. HTTP by hand: requests, responses, cookies and redirects, watched in the browser's developer tools.
  2. The same-origin policy and CORS, with two small servers of your own on different ports.
  3. Build a small login form, then protect it: hashing, sessions, CSRF tokens, secure cookies.
  4. Work through a deliberately vulnerable web app that you host locally, finding each flaw class and then patching it.
  5. Add a Content-Security-Policy to a real project and fix what breaks.

Related tags

#http #browsers #appsec #secure-coding #frontend

No has iniciado sesión, así que esto se publica como anónimo: no se guarda con ello ninguna cuenta, nombre ni dirección, y no puede llevar enlaces ni imágenes. Inicia sesión o únete para publicar con tu nombre. Los registros de nuestro servidor web guardan la dirección y la hora de cada petición hasta 14 días; para que la tuya no quede en ellos, usa Tor. Para escribir al equipo de forma confidencial, usa el buzón. Firmar como fuente habitual (una clave guardada solo en este navegador)

Enviar tarda unos segundos aquí: tu navegador resuelve antes una prueba de trabajo contra el spam.

Responder