Advanced Search
Start Your Free Trial

Overview

Other Readers Also Read...
PHP Hacks

PHP Hacks
by Jack Herrington

PHP Cookbook, 2nd Edition

PHP Cookbook, 2nd Edition
by Adam Trachtenberg; David Sklar

Programming PHP, 2nd Edition

Programming PHP, 2nd Edition
by Kevin Tatroe; Rasmus Lerdorf; Peter MacIntyre

Top Sellers in this Category

Programming PHP, 2nd Edition

Programming PHP, 2nd Edition
by Kevin Tatroe; Rasmus Lerdorf; Peter MacIntyre

Cloud Security and Privacy, 1st Edition

Cloud Security and Privacy, 1st Edition
by Tim Mather; Subra Kumaraswamy; Shahed Latif

Being highly flexible in building dynamic, database-driven web applications makes the PHP programming language one of the most popular web development tools in use today. It also works beautifully with other open source tools, such as the MySQL database and the Apache web server. However, as more web sites are developed in PHP, they become targets for malicious attackers, and developers need to prepare for the attacks.

Security is an issue that demands attention, given the growing frequency of attacks on web sites. Essential PHP Security explains the most common types of attacks and how to write code that isn't susceptible to them. By examining specific attacks and the techniques used to protect against them, you will have a deeper understanding and appreciation of the safeguards you are about to learn in this book.

In the much-needed (and highly-requested) Essential PHP Security, each chapter covers an aspect of a web application (such as form processing, database programming, session management, and authentication). Chapters describe potential attacks with examples and then explain techniques to help you prevent those attacks.

Topics covered include:

  • Preventing cross-site scripting (XSS) vulnerabilities

  • Protecting against SQL injection attacks

  • Complicating session hijacking attempts

You are in good hands with author Chris Shiflett, an internationally-recognized expert in the field of PHP security. Shiflett is also the founder and President of Brain Bulb, a PHP consultancy that offers a variety of services to clients around the world.

Amazon.com® Reader Reviews (Ranked by Helpfulness)

Average Amazon.com® Rating: 4.0 out of 5 rating Based on 18 Ratings

Overpriced - 2007-01-03
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
Of the 103 pages in the book there are probably only 13 of unique information and 90 pages of saying the same exact thing over and over again. Worse yet, I found the author had already released the 13 pages of useful information online for free.

Definitely wish I had browsed this one in a store before I blew $30.

IT MAY BE SHORT, BUT SIZE DOESN'T MATTER! - 2009-10-07
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
The book is only 85 pages long (if you take out the Appendices and filler material). That alone gets it four out of five stars. Well... not really... but there's a lot to be said for producing a book that will actually get read. You can read the whole thing in one bathroom sitting, assuming you just returned from Mexico. By comparison, similar books like "Pro PHP Security" by Chris Snyder and Michael Southwell (also a very good book) are more along the lines of 500 pages and such books are intended as comprehensive reference books rather than tutorials. You'd have to eat at a restaurant in North Korea to get all the way through the Pro PHP Security book. Seriously though - the criticisms of this book primarily pretain to its lack of detail - but I'd rather actually finish a high level book than have a detailed book sit on my shelf unread.

Chris' book is great. It's chocked full of easy to understand explanations and little five line code fragments to demonstrate what he's explaining. Sure enough, if you read the whole thing, you'll understand the essentials of PHP Security. Hey - perhaps that explains the title?

Do I need this book if my company already uses web scanning security software? Yes - you won't understand the problems that those products identify if you don't understand PHP security basics. If you don't understand reported errors, You'll be tempted to ignore or suppress warnings that you don't understand. Chris' book will give you the knowledge that you need in a few easy to follow pages.

There are a few ommissions. They include:

OMISSION #1: The book should mention somewhere that many of the security vulnerabilities it describes are not unique to PHP - especially big ones like cross-site scripting and SQL injection. While PHP has some vulnerabilities that other languages do not (and vis-versa), Java, C#, Ruby, and all the other server-side languages can also be attacked with cross-site scripting, SQL injection, session spoofing, cookie theft, backdoor URLs, etc., etc.

OMISSION #2: The book would have benefited from the addition of a page of system administration best practices to improve security rather than confining itself only to coding best practices. For example, it's easy for developers to accidentally open security holes by making very small changes to the PHP.ini file. A good best practice is to use the operating system to restrict access to that file in the production environment. Or it would have good to see Chris distill role-based security administration policies, logging, or remote procedure call policies down to just the most important principles. He has a knack for filtering out the noise, and if he had added that additional 86th page, I swear I would have read it too.

OMISSION #3: It's worth mentioning how modular design has a very big impact on the number of vulnerabilities inside an application. This is especially important for PHP, because PHP code is often a little more haphazard than code written in other languages - primarily because of the culture that surrounds PHP but also for a few other reasons (we cover those reasons in the PHP Chapter of our own book on the strengths and weaknesses of various technologies).

Bottom line:

These criticisms are very minor. The book is short, easy-to-read, and filled with information that is absolutely essential to know if you are to responsibly deploy a server-side PHP application. Look at the table of contents. If you're not familiar with those terms, you'd better get the book.

Glenn Hostetler
Web Service and SOA Technologies

I wanted so much to love this book - 2008-12-31
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
I really wanted to write a glowing review of Mr. Shiflett's book, Essential PHP Security, but I can't help but dissapointed by the weaknesses.

The author's blog (http://shiflett.org/) and PHP security website (http://phpsec.org/) are good sources of information on PHP security and web creation in general. With the wisdom hinted at via his websites, I looked forward to more in depth insights and specifics in his book. Unfortunately for Mr. Shiflett, writing a book is not like writing 'bites' for a blog or marketing yourself as experienced and knowledgable. This book reads like an anthology of blog articles and seminar presentations and that weakness kills what should otherwise really be an essential text.

As another helpful reviewer pointed out, this book is a not appropriate for new PHP programmers. That reviewer also noted that it is precisely new initiates to PHP that need these lessons the most. The protective measures suggested in the book are presented superficially. The author highlights the vulnerability, but then only hints at a protective measure by providing a code snip-it which totally lacks context. Most novice readers expect examples of how to apply and integrate the suggested technique effectively and efficiently within the basics they already know.

Mr. Shiflett writes in his acknowledgements, "Written during one of the busiest years of my life ... [the people at O'reilly] have gone out of their way to make the entire process fit around my writing style and busy schedule."

Smoking gun?

For a full price book, the author had room, but perhaps not the desire to provide more substance. Concise does not have to be superficial. The book's main content is 85 pages -- followed by three appendices between pages 87 and 103. The index runs between pages 105 and 109. Substantive implementation details are missing and should have been included.

For example, in chapter 1 and later in chapter 2, the author recommends filtering input by identifying input, filtering the input, and distinguishing between filtered and unfiltered (tainted) data. This recommendation is explicitly explained twice in the book and repeated throughout. If you expect any examples demonstrating this in practical use, there are none. If you expect a class that exemplifies a way you might integrate this technique with your exsisting code, there is none. In other words, if you want to learn even remotely by example, you may be disappointed by this book.

As a last note, Appendix C talks briefly about cryptography in PHP. Based on this book, cryptography does not appear to be one of the author's strong areas of knowledge. For new PHP programmers who also work with SQL, Mr. Shiflett gives you just enough information to frustrate you (at best -- or hang yourself at worst). The author lists a number of other books and websites about cryptography on the first page of the Appendix. That is his best advice. Also take a look at http://www.openssl.org/ as an information resource.

In sum, I don't argue with the value of the hints Mr. Shiflett provides in his book, but this book is weak on substance and does not provide the examples necessary to teach the reader that the suggestions are practical for real implementation. Perhaps instead of this book, the many authors of the "How to PHP and MySQL" clone books need to integrate and implement these protective measures in their texts right from the start. Unfortunately, Mr. Shiflett's book does not bridge the existing gap. If you buy this book, expect to be searching other books and the web for ways to effectively and efficiently perform the tasks the author recommends. If you already know how to implement the measures, you probably did not need this book in the first place.

Opened my eyes! - 2007-11-16
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
While smaller than many O'Reilly titles the author wastes no time in helping the new PHP programmer write more secure code. Once you get the best practices in the first chapter down, the other seven chapters each deal with a specific class of vulnerability. You can read chapters 2-8 in any order, and you'll also spend some time with the appendices.

I confess, this book made me want to go back over my code and refactor it from the ground up! Chris gives really easy ways to prevent the more common attacks. A day to a day and a half to read this book and then build your habit library will take you far in building more secure PHP code.

Good for non-php too - 2009-09-20
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
I'm not a PHP developer but found this book useful for other languages besides PHP. A lot of the security topics it covers are pretty general and apply to most languages/frameworks. It's pretty easy to distill the general concepts and take them with you elsewhere. Plus they're pretty worthwhile, important security tips.

Browse Similar Topics

Top Level Categories:
Internet/Online
Security

Sub-Categories:
Internet/Online > PHP
Security > Internet/Online

Some information on this page was provided using data from Amazon.com®. View at Amazon >


About Safari Books Online • Terms of Service • Privacy Policy • Contact Us • Corporate Licenses • Help • Accessibility | See us on FacebookSee us on Linked InSee us on TwitterRSS

Copyright 2009 Safari Books Online. All rights reserved.