“Thorough and comprehensive coverage from one of the foremost experts in browser security.”—Tavis Ormandy, Google Inc.

Modern web applications are built on a tangle of technologies that have been developed over time and then haphazardly pieced together. Every piece of the web application stack, from HTTP requests to browser-side scripts, comes with important yet subtle security consequences. To keep users safe, it is essential for developers to confidently navigate this landscape.

In The Tangled Web, Michal Zalewski, one of the world’s top browser security experts, offers a compelling narrative that explains exactly how browsers work and why they’re fundamentally insecure. Rather than dispense simplistic advice on vulnerabilities, Zalewski examines the entire browser security model, revealing weak points and providing crucial information for shoring up web application security. You’ll learn how to:

Perform common but surprisingly complex tasks such as URL parsing and HTML sanitization

Use modern security features like Strict Transport Security, Content Security Policy, and Cross-Origin Resource Sharing

Leverage many variants of the same-origin policy to safely compartmentalize complex web applications and protect user credentials in case of XSS bugs

Embed or host user-supplied content without running into the trap of content sniffing

For quick reference, “Security Engineering Cheat Sheets” at the end of each chapter offer ready solutions to problems you’re most likely to encounter. With coverage extending as far as planned HTML5 features, The Tangled Web will help you create secure web applications that stand the test of time.

Author Bio

Michal Zalewski is an internationally recognized information security expert with a long track record of delivering cutting-edge research. He is credited with discovering hundreds of notable security vulnerabilities and frequently appears on lists of the most influential security experts. He is the author of Silence on the Wire (No Starch Press), Google's "Browser Security Handbook," and numerous important research papers.

"I recommend reading this book if you want to know a lot, and I mean a lot, about how screwed up Web browsers, protocols, and related technologies truly are."
—Richard Bejtlich, TaoSecurity (Read More)

"A must-read for anyone who values their security and privacy online."
—Collin Jackson, Researcher at the Carnegie Mellon Web Security Group

"Perhaps the most thorough and insightful treatise on the state of security for web-driven technologies to date. A must have!"
—Mark Dowd, Azimuth Security, Author of The Art of Software Security Assessment

"The best book out there on web security right now."
—Dave Aitel, Dailydave (Read More)

"Does a fine job of dissecting the anatomy of the Web and offering an extensive look at browser security features and what to look for in the future. The issues covered are truly current and faced by all security professionals."
—Elhadji Sarr, Security Management Magazine (Read More)

"A must read for any web developer, anyone that wonders why the Blue Coat proxy system chucks out such strange packets, and anyone that really wants to understand how the web works from a security perspective."
—Stephen Northcutt, SANS.edu (Read More)

"The Tangled Web captures a lot of nuances between CSS and JavaScript implementations. Each chapter concludes with a great cheat sheet. Overall, I enjoyed the book. If you test or build web apps then you will too."
—Chris Rohlf, Matasano Security, EM_386 (Read More)

"Most security books either focus on underlying theory or on a single application or service, covered in detail. What's interesting about The Tangled Web is that it does some of both. Unlike a lot of people, Zalewski...knows his internet history, and he uses the right amount of it to put today's problems in context and explain their genesis."
—Wendy Grossman, ZDNet UK (Read More)

"I love this book... there's no other way to say it. Every once in a while you get a book that's well written, contains good content, and sparks those little ideas in the back of your brain."
—Chris John Riley, Caтcн22 (in)secuяity (Read More)

"Of particular value is the discussion of how features interact, sometimes in unexpected ways, to make what seems an innocuous or even beneficial change become a disaster waiting to happen. The practical guidance on how to avoid such pitfalls and do a better job with security using the currently available technology is both timely and to-the-point."
—Richard Austin, IEEE Cipher (Read More)

"The book offers a fascinating insight into technologies we all use and appreciate, and is a definite must-read (and re-read) for web developers and everyone else who deals with web application security."
—Help Net Security (Read More)

"The sort of book that should be required reading for every web developer."
—Packet Storm (Read More)

"While I thought that I knew all about a lot of the areas that this book covers, in just about every section the author went beyond what I knew to discuss aspects of the technology that I had never considered."
—Stephen Chapman, Felgall.com (Read More)

"A fantastic book on the current state of affairs for web security, and one which I cannot help but classify as 5 stars."
—Defensive Depth Consulting (Read More)

"If you're a developer, tester, or infrastructure implementer, you would be wise to read and then re-read The Tangled Web."
—Michael Larsen, TESTHEAD (Read More)

"Perhaps one the most valuable parts of The Tangled Web is how Zalewski adds a handy "Security Engineering Cheat Sheet" to the end of each chapter. Having these quick tips at ones fingertips is a remarkable asset and great addition to the book."
—Cory Gackenheimer, cgack.com (Read More)

"The amount of knowledge conveyed in the book is breath-taking."
—404 Tech Support (Read More)

"Michal Zalewski has a colorful writing style. His book is serious and loaded with technical detail, but that doesn't stop him from turning a nice phrase here and there."
—John D. Cook, The Endeavor (Read More)

"This is a must read for anyone who wants to engage web client security on a professional level."
—Gynvael "GynDream" Coldwind, gynvael.coldwind.pl/ (Read More)

"Whether you work in IT security or are a web application developer, this definitely is a book you don't want to miss."
—Michael Kohl, Citizen428.blog (Read More)

"Zalewski's book puts a bright, uncomfortable spotlight on the fundamental insecurities of Web browsers, but it also shows you how to improve the security of Web applications."
—Books, Books & More (New) Books (Read More)

"A solid book, full of interesting and useful information. For web developers and security experts it should be a must read book."
—Jorge Tavares Weblog (Read More)

"If you're a web developer and want to get a better understanding of security I think this is a very good book and worth checking out."
—Patrick Gillespie, patorjk.com (Read More)

Updates

Page 24
In Figure 2-1, number 3 states that a login and password are separated by a point (login.password). They should instead be separated by a colon (login:password).