Preface |
|
xiii | |
|
1 The History of Software Security |
|
|
1 | (20) |
|
|
1 | (1) |
|
The Enigma Machine, Circa 1930 |
|
|
2 | (3) |
|
Automated Enigma Code Cracking, Circa 1940 |
|
|
5 | (3) |
|
|
7 | (1) |
|
Telephone "Phrealdng," Circa 1950 |
|
|
8 | (2) |
|
Anti-Phreaking Technology, Circa 1960 |
|
|
10 | (1) |
|
The Origins of Computer Hacking, Circa 1980 |
|
|
11 | (1) |
|
The Rise of the World Wide Web, Circa 2000 |
|
|
12 | (3) |
|
Hackers in the Modern Era, Circa 2015+ |
|
|
15 | (3) |
|
|
18 | (3) |
Part I. Recon |
|
|
2 Introduction to Web Application Reconnaissance |
|
|
21 | (6) |
|
|
21 | (2) |
|
|
23 | (2) |
|
|
25 | (2) |
|
3 The Structure of a Modern Web Application |
|
|
27 | (26) |
|
Modern Versus Legacy Web Applications |
|
|
27 | (2) |
|
|
29 | (3) |
|
JavaScript Object Notation |
|
|
32 | (1) |
|
|
33 | (12) |
|
|
34 | (2) |
|
|
36 | (1) |
|
|
37 | (1) |
|
|
38 | (3) |
|
|
41 | (3) |
|
|
44 | (1) |
|
|
45 | (1) |
|
Authentication and Authorization Systems |
|
|
46 | (2) |
|
|
47 | (1) |
|
|
47 | (1) |
|
|
48 | (1) |
|
|
49 | (1) |
|
|
50 | (1) |
|
|
51 | (2) |
|
|
53 | (24) |
|
Multiple Applications per Domain |
|
|
53 | (1) |
|
The Browser's Built-In Network Analysis Tools |
|
|
54 | (3) |
|
Taking Advantage of Public Records |
|
|
57 | (8) |
|
|
58 | (2) |
|
|
60 | (2) |
|
|
62 | (3) |
|
|
65 | (2) |
|
|
67 | (5) |
|
|
72 | (3) |
|
|
75 | (2) |
|
|
77 | (10) |
|
|
77 | (4) |
|
Authentication Mechanisms |
|
|
81 | (1) |
|
|
82 | (2) |
|
|
82 | (1) |
|
Application-Specific Shapes |
|
|
83 | (1) |
|
|
84 | (3) |
|
6 Identifying Third-Party Dependencies |
|
|
87 | (12) |
|
Detecting Client-Side Frameworks |
|
|
87 | (5) |
|
|
88 | (2) |
|
Detecting JavaScript Libraries |
|
|
90 | (1) |
|
|
91 | (1) |
|
Detecting Server-Side Frameworks |
|
|
92 | (4) |
|
|
92 | (1) |
|
Default Error Messages and 404 Pages |
|
|
92 | (3) |
|
|
95 | (1) |
|
|
96 | (3) |
|
7 Identifying Weak Points in Application Architecture |
|
|
99 | (10) |
|
Secure Versus Insecure Architecture Signals |
|
|
100 | (4) |
|
Multiple Layers of Security |
|
|
104 | (1) |
|
|
105 | (2) |
|
|
107 | (2) |
|
|
109 | (4) |
Part II. Offense |
|
|
9 Introduction to Hacking Web Applications |
|
|
113 | (4) |
|
|
113 | (1) |
|
|
114 | (3) |
|
10 Cross-Site Scripting (XSS) |
|
|
117 | (14) |
|
XSS Discovery and Exploitation |
|
|
118 | (3) |
|
|
121 | (2) |
|
|
123 | (3) |
|
|
126 | (2) |
|
|
128 | (2) |
|
|
130 | (1) |
|
11 Cross-Site Request Forgery (CSRF) |
|
|
131 | (10) |
|
Query Parameter Tampering |
|
|
131 | (5) |
|
|
136 | (1) |
|
CSRF Against POST Endpoints |
|
|
137 | (2) |
|
|
139 | (2) |
|
12 XML External Entity (XXE) |
|
|
141 | (6) |
|
|
141 | (4) |
|
|
145 | (1) |
|
|
146 | (1) |
|
|
147 | (14) |
|
|
147 | (4) |
|
|
151 | (4) |
|
|
155 | (3) |
|
|
158 | (3) |
|
14 Denial of Service (DoS) |
|
|
161 | (10) |
|
|
162 | (2) |
|
Logical DoS Vulnerabilities |
|
|
164 | (3) |
|
|
167 | (2) |
|
|
169 | (2) |
|
15 Exploiting Third-Party Dependencies |
|
|
171 | (12) |
|
|
173 | (3) |
|
|
174 | (1) |
|
Self-Hosted Application Integrations |
|
|
174 | (1) |
|
|
175 | (1) |
|
|
176 | (4) |
|
|
176 | (2) |
|
|
178 | (1) |
|
|
179 | (1) |
|
Common Vulnerabilities and Exposures Database |
|
|
180 | (1) |
|
|
181 | (2) |
|
|
183 | (4) |
Part III. Defense |
|
|
17 Securing Modern Web Applications |
|
|
187 | (6) |
|
Defensive Software Architecture |
|
|
188 | (1) |
|
Comprehensive Code Reviews |
|
|
188 | (1) |
|
|
189 | (1) |
|
|
190 | (1) |
|
|
190 | (1) |
|
|
191 | (1) |
|
|
191 | (1) |
|
Applied Recon and Offense Techniques |
|
|
192 | (1) |
|
18 Secure Application Architecture |
|
|
193 | (12) |
|
Analyzing Feature Requirements |
|
|
193 | (2) |
|
Authentication and Authorization |
|
|
195 | (6) |
|
Secure Sockets Layer and Transport Layer Security |
|
|
195 | (2) |
|
|
197 | (1) |
|
|
197 | (3) |
|
|
200 | (1) |
|
|
201 | (1) |
|
|
201 | (2) |
|
|
203 | (2) |
|
19 Reviewing Code for Security |
|
|
205 | (10) |
|
How to Start a Code Review |
|
|
206 | (1) |
|
Archetypical Vulnerabilities Versus Custom Logic Bugs |
|
|
207 | (2) |
|
Where to Start a Security Review |
|
|
209 | (2) |
|
Secure-Coding Anti-Patterns |
|
|
211 | (3) |
|
|
211 | (1) |
|
|
212 | (1) |
|
Trust-By-Default Anti-Pattern |
|
|
213 | (1) |
|
|
213 | (1) |
|
|
214 | (1) |
|
20 Vulnerability Discovery |
|
|
215 | (10) |
|
|
215 | (6) |
|
|
216 | (1) |
|
|
217 | (1) |
|
Vulnerability Regression Testing |
|
|
218 | (3) |
|
Responsible Disclosure Programs |
|
|
221 | (1) |
|
|
222 | (1) |
|
Third-Party Penetration Testing |
|
|
223 | (1) |
|
|
224 | (1) |
|
21 Vulnerability Management |
|
|
225 | (10) |
|
Reproducing Vulnerabilities |
|
|
225 | (1) |
|
Ranking Vulnerability Severity |
|
|
226 | (1) |
|
Common Vulnerability Scoring System |
|
|
226 | (6) |
|
|
228 | (2) |
|
|
230 | (1) |
|
CVSS: Environmental Scoring |
|
|
231 | (1) |
|
Advanced Vulnerability Scoring |
|
|
232 | (1) |
|
Beyond Triage and Scoring |
|
|
232 | (1) |
|
|
233 | (2) |
|
22 Defending Against XSS Attacks |
|
|
235 | (12) |
|
Anti-XSS Coding Best Practices |
|
|
235 | (2) |
|
|
237 | (4) |
|
|
238 | (1) |
|
|
238 | (1) |
|
|
239 | (1) |
|
|
239 | (1) |
|
|
240 | (1) |
|
|
241 | (1) |
|
Content Security Policy for XSS Prevention |
|
|
242 | (3) |
|
|
242 | (1) |
|
Unsafe Eval and Unsafe Inline |
|
|
243 | (1) |
|
|
244 | (1) |
|
|
245 | (2) |
|
23 Defending Against CSRF Attacks |
|
|
247 | (8) |
|
|
247 | (2) |
|
|
249 | (1) |
|
|
250 | (1) |
|
Anti-CRSF Coding Best Practices |
|
|
250 | (3) |
|
|
251 | (1) |
|
Application-Wide CSRF Mitigation |
|
|
252 | (1) |
|
|
253 | (2) |
|
|
255 | (4) |
|
Evaluating Other Data Formats |
|
|
256 | (1) |
|
|
257 | (1) |
|
|
257 | (2) |
|
25 Defending Against Injection |
|
|
259 | (10) |
|
|
259 | (4) |
|
|
260 | (1) |
|
|
261 | (2) |
|
Database-Specific Defenses |
|
|
263 | (1) |
|
Generic Injection Defenses |
|
|
263 | (3) |
|
Potential Injection Targets |
|
|
263 | (1) |
|
Principle of Least Authority |
|
|
264 | (1) |
|
|
265 | (1) |
|
|
266 | (3) |
|
|
269 | (6) |
|
Protecting Against Regex DoS |
|
|
270 | (1) |
|
Protecting Against Logical DoS |
|
|
270 | (1) |
|
|
271 | (2) |
|
|
272 | (1) |
|
|
273 | (2) |
|
27 Securing Third-Party Dependencies |
|
|
275 | (6) |
|
Evaluating Dependency Trees |
|
|
275 | (2) |
|
Modeling a Dependency Tree |
|
|
276 | (1) |
|
Dependency Trees in the Real World |
|
|
277 | (1) |
|
|
277 | (1) |
|
Secure Integration Techniques |
|
|
277 | (2) |
|
|
278 | (1) |
|
Secure Package Management |
|
|
278 | (1) |
|
|
279 | (2) |
|
|
281 | (8) |
|
The History of Software Security |
|
|
281 | (2) |
|
Web Application Reconnaissance |
|
|
283 | (1) |
|
|
284 | (1) |
|
|
285 | (4) |
|
|
289 | (2) |
Index |
|
291 | |