A Revised Guide to Building Secure Web Applications and Web Services
Total Page:16
File Type:pdf, Size:1020Kb
A Revised Guide to Building Secure Web Applications and Web Services 2.1.0 OWASP/vgr Edition January 10, 2010 Copyright © 2010 VGR www.edainworks.com as a Derived Work from OWASP Guide 2.0.1 BlackHat++ edition © 2002-2005 the Open Web Application Security Project (OWASP). All Rights Reserved. Permission is granted to copy, distribute, and/or modify this document provided this copyright notice and attribution to OWASP is retained. 1. Frontispiece 1. Frontispiece Dedication Je dédie cette version à tous les développeurs ouaibe qui attendaient depuis 2005 une révision du Guide OWASP 2.0 . I dedicate this version to all the Web Developers which waited since 2005 for a revision of the OWASP 2.0 Guide. VGR, January 2010 Copyright and license © 2010 VGR for some corrections, all other parts © 2001 – 2005 Free Software Foundation The Guide is licensed under the Free Documentation License, a copy of which is found in the Appendix. PERMISSION IS GRANTED TO COPY, DISTRIBUTE, AND/OR MODIFY THIS DOCUMENT PROVIDED THIS COPYRIGHT NOTICE AND ATTRIBUTION TO OWASP IS RETAINED. Editors The Guide has had several editors, all of whom have contributed immensely as authors, project managers, and editors over the lengthy period of the Guide’s gestation Adrian Wiesmann Mark Curphey Andrew van der Stock Ray Stirbei Vincent « Hefiz »Graux [VGR] Authors and Reviewers The Guide would not be where it is today without the generous gift of volunteer time and effort from many individuals. If you are one of them, and not on this list, please contact VGR, [email protected] 1 / 314 1. Frontispiece Abraham Kang Eoin Keary Mikael Simonsson Adrian Wiesmann Ernesto Arroyo Neal Krawetz Alex Russell Frank Lemmon Nigel Tranter Amit Klein Gene McKenna Raoul Endres Andrew van der Stock Hal Lockhart Ray Stirbei Brian Greidanus Izhar By-Gad Richard Parke Christopher Todd Jeremy Poteet Robert Hansen Darrel Grundy José Pedro Arroyo Roy McNamara David Endler K.K. Mookhey Steve Taylor Denis Piliptchouk Kevin McLaughlin Sverre Huseby Dennis Groves Mark Curphey Tim Smith Derek Browne Martin Eizner Vincent «Hefiz» Graux Michael Howard William Hau Revision History Date Version Pages Notes July 27, 2005 2.0.1 Blackhat Edition++ 293 pages Cryptography chapter review from Michael Howard incorporated December 31, 2009 2.0.1 Blackhat Edition++ 290 pages VGR, www.edainworks.com, from the official PDF version. No changes except two typos. ISO 26300:2006 Open Document Format version (807 KB) January 02, 2010 2.1.0 OWASP/vgr 314 pages •Typos and Errors fixes and PHP code review for all sections. •Ajax and Deployment sections added from CVS. •« PHP Guidelines » section deleted. •References were updated (eg, ISO 17799 updated to 27002). •State of the Art was updated as of 2009 year end. •Empty and unfinished paragraphs deleted (hidden text). •Sections and paragraphs were numbered to provide a stable reference. VGR www.edainworks.com ISO 26300:2006 Open Document Format version (2242 KB) 2 / 314 1. Frontispiece Table Of Contents 1. FRONTISPIECE....................................................................................................................................................1 DEDICATION.....................................................................................................................................................1 COPYRIGHT AND LICENSE.....................................................................................................................................1 EDITORS.........................................................................................................................................................1 AUTHORS AND REVIEWERS..................................................................................................................................1 REVISION HISTORY............................................................................................................................................2 2. ABOUT THE OPEN WEB APPLICATION SECURITY PROJECT........................................................................................10 2.1 STRUCTURE AND LICENSING.........................................................................................................................10 2.2 PARTICIPATION AND MEMBERSHIP...................................................................................................................10 2.3 PROJECTS................................................................................................................................................11 3. INTRODUCTION.................................................................................................................................................12 4. WHAT ARE WEB APPLICATIONS?...........................................................................................................................14 4.1 OVERVIEW...............................................................................................................................................14 4.2 TECHNOLOGIES.........................................................................................................................................14 5. POLICY FRAMEWORKS.......................................................................................................................................28 5.1 OVERVIEW...............................................................................................................................................28 5.2 ORGANIZATIONAL COMMITMENT TO SECURITY.....................................................................................................28 5.3 OWASP’S PLACE AT THE FRAMEWORK TABLE.................................................................................................29 5.7 DEVELOPMENT METHODOLOGY.....................................................................................................................32 5.8 CODING STANDARDS..................................................................................................................................32 5.9 SOURCE CODE CONTROL............................................................................................................................33 6. SECURE CODING PRINCIPLES..............................................................................................................................34 6.1 OVERVIEW...............................................................................................................................................34 6.2 ASSET CLASSIFICATION...............................................................................................................................34 6.3 ABOUT ATTACKERS.....................................................................................................................................34 6.4 CORE PILLARS OF INFORMATION SECURITY........................................................................................................35 SECURITY ARCHITECTURE..................................................................................................................................35 6.5 SECURITY PRINCIPLES................................................................................................................................36 7. THREAT RISK MODELING...................................................................................................................................41 7.1 THREAT RISK MODELING USING THE MICROSOFT THREAT MODELING PROCESS........................................................41 7.2 PERFORMING THREAT RISK MODELING..............................................................................................................41 7.2 ALTERNATIVE THREAT MODELING SYSTEMS......................................................................................................48 COMPARING THREAT MODELING APPROACHES..........................................................................................................52 7.3 CONCLUSION............................................................................................................................................54 7.4 FURTHER READING....................................................................................................................................54 8. HANDLING E-COMMERCE PAYMENTS.....................................................................................................................55 8.1 OBJECTIVES.............................................................................................................................................55 8.2 COMPLIANCE AND LAWS..............................................................................................................................55 8.3 PCI COMPLIANCE.....................................................................................................................................55 8.4 HANDLING CREDIT CARDS...........................................................................................................................56 8.5 FURTHER READING....................................................................................................................................61 9. PHISHING.......................................................................................................................................................62 9.1 WHAT IS PHISHING?...................................................................................................................................62