liveBook · Manning

What you will learn in Grokking Web Application Security

by Malcolm McDonald

Chapter by chapter

Chapter 1: Know your enemy

1.1 Figuring out how hackers attack you (and why) · 1.2 Surviving the fallout from getting hacked · 1.3 Determining how paranoid you should be · 1.4 Knowing where to start protecting yourself · 1.5 Keep track of new vulnerabilities · 1.6 Know what code you are deploying · 1.7 Log and monitor activity · 1.8 Convert your team members into security expert · 1.9 Slow down · 1.10 Summary

What you learn in chapter 1 →

Chapter 2: Browser security

2.1 The parts of a browser · 2.2 The JavaScript sandbox · 2.3 Content security policies · 2.4 The same-origin policy · 2.5 Cross-origin requests · 2.6 Subresource integrity checks · 2.7 Disk access · 2.8 The File API · 2.9 WebStorage · 2.10 IndexedDB · 2.11 Cookies · 2.12 Secure cookies · 2.13 HttpOnly cookies · 2.14 The SameSite attribute · 2.15 Expiring cookies · 2.16 Invalidating cookies · 2.17 Cross-site tracking · 2.18 Summary

What you learn in chapter 2 →

Chapter 3: Encryption

3.1 The principles of encryption · 3.2 Encryption keys · 3.3 Encryption in transit · 3.4 Taking practical steps · 3.5 Redirecting to HTTPS · 3.6 Telling the browser to always use HTTPS · 3.7 Encryption at rest · 3.8 Password hashing · 3.9 Salting · 3.10 Integrity checking · 3.11 Summary

What you learn in chapter 3 →

Chapter 4: Web server security

4.1 Validating input · 4.2 Allow lists · 4.3 Block lists · 4.4 Pattern matching · 4.5 Further validation · 4.6 Email validation · 4.7 Validating file uploads · 4.8 Escaping output · 4.9 Escaping output in the HTTP response · 4.10 Escaping output in database commands · 4.11 Escaping output in command strings · 4.12 Handling resources · 4.13 Representation State Transfer (REST) · 4.14 Defense in depth · 4.15 The principle of least privilege · 4.16 Summary

What you learn in chapter 4 →

Chapter 5: Security as a process

5.1 Using the four-eyes principle · 5.2 Applying the principle of least privilege to processes · 5.3 Automating everything you can · 5.4 Not reinventing the wheel · 5.5 Keeping audit trails · 5.6 Writing code securely · 5.7 Using source control · 5.8 Managing dependencies · 5.9 Designing a build process · 5.10 Writing unit tests · 5.11 Performing code reviews · 5.12 Automating your release processes · 5.13 Deploying to preproduction environments · 5.14 Rolling back code · 5.15 Using tools to protect yourself · 5.16 Dependency analysis · 5.17 Static analysis · 5.18 Automated penetration testing · 5.19 Firewalls · 5.20 Intrusion detection systems · 5.21 Antivirus software · 5.22 Owning your mistakes · 5.23 Summary

What you learn in chapter 5 →

Chapter 6: Browser vulnerabilities

6.1 Cross-site scripting · 6.2 Stored cross-site scripting · 6.3 Reflected cross-site scripting · 6.4 DOM-based cross-site scripting · 6.5 Protecting against cross-site scripting by using escaping · 6.6 Escaping in client-side templating · 6.7 Content security policies · 6.8 Cross-site request forgery · 6.9 Making your GET requests free of side effects · 6.10 Anti-CSRF tokens · 6.11 Ensuring that your cookies are sent with the SameSite attribute · 6.12 Clickjacking · 6.13 Protecting against clickjacking · 6.14 X-Frame-Options · 6.15 Cross-site script inclusion · 6.16 Protecting against XSSI · 6.17 Setting a cross-origin resource policy · 6.18 Summary

What you learn in chapter 6 →

Chapter 7: Network vulnerabilities

7.1 Monster-in-the-middle vulnerabilities · 7.2 Intercepting traffic on a network · 7.3 Taking advantage of mixed protocols · 7.4 Downgrade attacks · 7.5 Misdirection vulnerabilities · 7.6 Doppelganger domains · 7.7 DNS poisoning · 7.8 Subdomain squatting · 7.9 Certificate compromise · 7.10 Certificate revocation · 7.11 Certificate transparency · 7.12 Stolen keys · 7.13 Summary

What you learn in chapter 7 →

Chapter 8: Authentication vulnerabilities

8.1 Brute-force attacks · 8.2 Single sign-on · 8.3 OpenID Connect and OAuth · 8.4 Security Assertion Markup Language · 8.5 Strengthening your authentication · 8.6 Password complexity rules · 8.7 CAPTCHAs · 8.8 Rate limiting · 8.9 Multifactor authentication · 8.10 Biometrics · 8.11 Storing credentials · 8.12 Hashing, salting, and peppering your passwords · 8.13 Secure credentials for outbound access · 8.14 User enumeration · 8.15 Public usernames · 8.16 Timing attacks · 8.17 Summary

What you learn in chapter 8 →

Chapter 9: Session vulnerabilities

9.1 How sessions work · 9.2 Server-side sessions · 9.3 Client-side sessions · 9.4 JSON Web Tokens · 9.5 Session hijacking · 9.6 Session hijacking on the network · 9.7 Session hijacking via cross-site scripting · 9.8 Weak session identifiers · 9.9 Session fixation · 9.10 Session tampering · 9.11 Summary

What you learn in chapter 9 →

Chapter 10: Authorization vulnerabilities

10.1 Modeling authorization · 10.2 Case study 1: The web forum · 10.3 Case study 2: The content platform · 10.4 Case study 3: The messaging tool · 10.5 Designing authorization · 10.6 Implementing access control · 10.7 URL access restrictions · 10.8 Authorization errors versus redirects · 10.9 URL scheme organization · 10.10 Model-View-Controller · 10.11 Client-side authorization · 10.12 Time-boxed authorization · 10.13 Testing authorization · 10.14 Unit tests · 10.15 Mocking libraries · 10.16 Spotting common authorization flaws · 10.17 Missing access control · 10.18 Confusion about which code components enforce access control · 10.19 Violations of trust boundaries · 10.20 Access-control decisions based on untrusted input · 10.21 Summary

What you learn in chapter 10 →

Chapter 11: Payload vulnerabilities

11.1 Deserialization attacks · 11.2 JSON vulnerabilities · 11.3 Prototype pollution · 11.4 XML vulnerabilities · 11.5 XML validation · 11.6 XML bombs · 11.7 XML external entity attacks · 11.8 Mitigating XML attacks · 11.9 File upload vulnerabilities · 11.10 Validate uploaded files · 11.11 Rename uploaded files · 11.12 Write to disk without the appropriate permissions · 11.13 Use secure file storage · 11.14 Path traversal · 11.15 Mass assignment · 11.16 Summary

What you learn in chapter 11 →

Chapter 12: Injection vulnerabilities

12.1 Remote code execution · 12.2 Domain-specific languages · 12.3 Server-side includes · 12.4 SQL injection · 12.5 Parameterized statements · 12.6 Object-relational mapping · 12.7 NoSQL injection · 12.8 MongoDB · 12.9 Couchbase · 12.10 Cassandra · 12.11 HBase · 12.12 LDAP injection · 12.13 Command injection · 12.14 CRLF injection · 12.15 Regex injection · 12.16 Summary

What you learn in chapter 12 →

Chapter 13: Vulnerabilities in third-party code

13.1 Dependencies · 13.2 Dependency versions · 13.3 Learning about vulnerabilities · 13.4 Deploying patches · 13.5 Farther down the stack · 13.6 Information leakage · 13.7 Removing server headers · 13.8 Changing the session cookie name · 13.9 Using clean URLs · 13.10 Scrubbing DNS entries · 13.11 Sanitizing template files · 13.12 Server fingerprinting · 13.13 Insecure configuration · 13.14 Configuring your web root directory · 13.15 Disabling client-side error reporting · 13.16 Changing default passwords · 13.17 Summary

What you learn in chapter 13 →

Chapter 14: Being an unwitting accomplice

14.1 Server-side request forgery · 14.2 Restricting the domains that you access · 14.3 Making HTTP requests only for real users · 14.4 Validating the URLs that you access · 14.5 Using a domain blocklist · 14.6 Email spoofing · 14.7 Sender Policy Framework · 14.8 DomainKeys Identified Mail · 14.9 Domain-Based Message Authentication, Reporting and Conformance · 14.10 Practical steps · 14.11 Open redirects · 14.12 Disallow offsite redirects · 14.13 Check the referrer when doing redirects · 14.14 Summary

What you learn in chapter 14 →

Chapter 15: What to do when you get hacked

15.1 Knowing when you’ve been hacked · 15.2 Stopping an attack in progress · 15.3 Figuring out what went wrong · 15.4 Preventing the attack from happening again · 15.5 Communicating details about the incident to users · 15.6 Deescalating future attacks · 15.7 Summary

What you learn in chapter 15 →

Concepts explained in this book

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.