惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
宝玉的分享
宝玉的分享
量子位
博客园 - Franky
The Cloudflare Blog
博客园 - 【当耐特】
Jina AI
Jina AI
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
罗磊的独立博客
V
V2EX
MongoDB | Blog
MongoDB | Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
H
Help Net Security
博客园 - 聂微东
F
Fortinet All Blogs
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Stack Overflow Blog
Stack Overflow Blog
博客园_首页
人人都是产品经理
人人都是产品经理

Maggie Appleton

The Dark Forest and Generative AI One Developer, Two Dozen Agents, Zero Alignment Gas Town’s Agent Patterns, Design Bottlenecks, and Vibecoding at Scale January 2026 | Maggie Appleton A Treatise on AI Chatbots Undermining the Enlightenment A Brief History & Ethos of the Digital Garden Vibe Code is Legacy Code May 2025 | Maggie Appleton Home-Cooked Software and Barefoot Developers Statistically, When Will My Baby Be Born? Speculative Calendar Events ChatGPT Would be a Decent Policy Advisor March 2025 | Maggie Appleton The Expanding Dark Forest and Generative AI Humanity's Last Exam Squish Meets Structure Common Misconceptions in AI Undetected AI Exam Answers Unbaited Smidgeons Growing a Human: The First 30 Weeks How to Import Academic Papers from Zotero into Tana December 2024 | Maggie Appleton Aesthetic Command Lines with Hyper, Spaceship, and Oh My Zsh Leaving Elicit July 2024 | Maggie Appleton A Short History of Bi-Directional Links The Pattern Language of Project Xanadu Assumed Audiences Ambient Co-presence
Defend Your Cookies with Essential Web Security Tactics
2020-02-08 · via Maggie Appleton

Between IoT botnet attacks, Bitcoin ransomware, and the weekly cadence of high-profile data breaches, doing anything on the internet feels like playing Russian Roulette.

And that’s just for normal people using it.

If you’re a developer, you’re partially responsible for protecting all those normal people from the horrors of whatever LulzSec are up to right now. The least you can do is make sure your website isn’t an accessory to their nefarious activities.

Thankfully, you do not have to brave the black hat darkness alone.

Mike Sherov made an egghead course that covers a whole series of web security essentials

https://egghead.io/courses/web-security-essentials-mitm-csrf-and-xss

I am (thankfully) not responsible enough for anyone to put me in charge of security for an important website. But I was still curious.

I wanted to know what the current landscape of internet risk looks like. How, exactly, is LulzSec going to hack into my mainframe in 2020?

Here’s my illustrated notes from Mike’s course that should give you a big picture overview of what to should look out for.

Web security essentials - Let's look at three common attacks

Turns out there’s a small set of fairly well-known and easy to defend attacks that we can protect ourselves from:

  • Man in the Middle (MITM)
  • Cross-Site Request Forgery (CSRF)
  • Cross-Site Scripting (XSS)

Shielding yourself from these three is a great starting point. It’s at least enough to keep the script kiddies out.

First, man in the middle is a piece of software that intercepts data between a client and a server

If this connection is over HTTP all your data packets are readable cleartext. Anyone on the network can use a packet sniffer to see your data. Instead we use HTTPS to encrypt packets.

How to protect yourself. Use HSTS headers. Require HTTPS everywhere. Redirect HTTP to HTTPS

Cross-site request forgery is an attack that tricks the user into visiting a malicious site while they're already logged into a trusted site

This is possible because browsers send cookies between sites by default. How to protect yourself. Cookies come with a 'sameSite' property that prevents them from being passed between sites. Set it to 'lax' or 'strict'

Cross-site scripting is an attack that injects malicious code into a trusted site. This can happen is the site allows user input to appear on the page without validating or encoding it. Protect yourself with a content security policy which manages which types of resources are allowed to load and where

Keeping out this trio of attacks will go a long way.

If (unlike me) you are responsible enough to be in charge of security for a moderately-sized website, it might be worth double checking you have these protections in place.

Better safe than sorry. Especially when sorry means you end up on the front page of Hacker News in this week’s edition of obviously preventable security breaches.


The fully illustrated notes on web security essentials


Want more illustrated notes on web development?

Take a look at Testing Apps with Cypress

Testing Apps with Cypress

Illustrated notes on how to test web apps with Cypress , The JAMStack, Gatsby & Contentful

The JAMStack, Gatsby & Contentful

Illustrated notes on the JAMstack, Gatsby & Contentful
or A Fresh Serving of JavaScript ES2019

A Fresh Serving of JavaScript ES2019

Illustrated notes on the new language changes in JavaScript ES2019