Start reading Essential PHP Security on your Kindle in under a minute. Don’t have a Kindle? Get your Kindle here.

Deliver to your Kindle or other device

 
   
  Try it free  
 
Sample the beginning of this book for free

Deliver to your Kindle or other device

 
   
 
Read books on your computer or other mobile devices
Get Kindle for PC
Mac version coming soon
Get Kindle for iPhone
Also works on iPod Touch
 
 
Essential PHP Security
 
See larger image
 

Essential PHP Security (Kindle Edition)

by Chris Shiflett (Author)
3.9 out of 5 stars  See all reviews (18 customer reviews)

Digital List Price: $23.99  What's this?
Print List Price:$29.95
Kindle Price: $14.39 & includes wireless delivery via Amazon Whispernet
You Save:$15.56 (52%)

Text-to-Speech: Enabled
Kindle Books
  • Kindle Books include wireless delivery - read your book on your Kindle within a minute of placing your order.
  • Don't have a Kindle? Get yours here.

Formats

Amazon Price New from Used from
  Kindle Edition $14.39 -- --
  Paperback $19.77 $15.75 $13.99

Customers Who Bought This Item Also Bought

Apache Security

Apache Security

4.7 out of 5 stars (15)  $15.39
Pro PHP Security

Pro PHP Security

3.9 out of 5 stars (7)  $29.93
PHP Objects, Patterns, and Practice, Second Edition

PHP Objects, Patterns, and Practice, Second Edition

4.6 out of 5 stars (9)  $23.75
Wicked Cool PHP

Wicked Cool PHP

4.6 out of 5 stars (16)  $9.99
PHP Object-Oriented Solutions

PHP Object-Oriented Solutions

4.8 out of 5 stars (6)  $19.53
Explore similar items

Editorial Reviews

Review

You've heard the nasty stories about PHP sites being wiped off the web by evil hackers? Sadly it's not scare-mongering as it does happen, and as much as we love PHP it needs proper security to keep your site safe from harm. Plenty of PHP books have the odd chapter on security but at last O'Reilly have published a whole volume dedicated to the cause, with all the code you'll need to keep everything in order. Each chapter covers a different aspect of the application, from form processing to database programming and session management. Written in a straight forward style, it's ideal for every PHP user, but at GBP20 you might expect a little more than just 100 pages." .NET, November 2005 "If you write PHP scripts, get a copy" - Alain Williams, news@UK, March 2006


Product Description

The PHP scripting language works beautifully with other open source tools, such as the MySQL database and Apache web server software, to build interactive web applications. But security is still an issue that developers need to address, given the frequency of attacks on web sites. Essential PHP Security explains the types of attacks that hackers use on web sites and how to correctly configure Apache and PHP to guard against them. The author of Essential PHP Security, Chris Shiflett, is an internationally recognized expert in the field of PHP security and this book shows developers how to guard against attacks by writing secure PHP code.

Product Details


What Do Customers Ultimately Buy After Viewing This Item?

Essential PHP Security
74% buy the item featured on this page:
Essential PHP Security 3.9 out of 5 stars (18)
$14.39
PHP Objects, Patterns, and Practice, Second Edition
26% buy
PHP Objects, Patterns, and Practice, Second Edition 4.6 out of 5 stars (9)
$23.75

Suggested Tags from Similar Products

 (What's this?)
Be the first one to add a relevant tag (keyword that's strongly related to this product).
 

Your tags: Add your first tag
 

 

Customer Reviews

18 Reviews
5 star:
 (9)
4 star:
 (2)
3 star:
 (5)
2 star:
 (1)
1 star:
 (1)
 
 
 
 
 
Average Customer Review
3.9 out of 5 stars (18 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

 
34 of 36 people found the following review helpful:
3.0 out of 5 stars Good overview of php security matters, November 2, 2005
By John A. Suda (Rochester NY) - See all my reviews
  
This review is from: Essential PHP Security (Paperback)

You would think that with all of the books being published recently about PHP that everyone and his mother is writing PHP code. This may be true, but even if it is not, it is certain that many people and businesses are using PHP code, in concert with other applications like MySQL, to produce dynamic web sites. This is all well and good because PHP is a high-quality coding language especially well-suited to web applications. It is also open-source, meaning well-supported by a community of coders and developers and cost-free. The one problem is that, like all coding languages, poorly designed or written PHP applications can be security risks potentially allowing Internet miscreants to cause damage to web servers, hosts, and users. It appears to be the case that there are many, many instances of insecure PHP code in use, hence, the value in a targeted book on PHP security, like "Essential PHP Security", by Chris Shiflett.

The author is an internationally-known and accomplished expert on PHP security. He is the founder of the PHP Security Consortium, a group of volunteers who help educate the PHP community, and a well-known contributor to the PHP-general mail digest. The book is designed to provide security information and guidelines and explain the most common types of attacks and how to prevent or repel them.

"Essential PHP Security" is a slight volume of only 109 pages, including index. Shiflett wastes no time and immediately jumps into his topic, starting with his opinion on the use of the PHP concept of "register globals", a configuration setting which he recommends against using in favor of "superglobal arrays". He next turns to how to configure your web server setup to properly deal with error reporting, both for the developer's use and to prevent providing clues to any interloper trying to illegally access your site.

The balance of Chapter 1 itemizes general principles of Internet security: Defense in Depth - redundantly using more than one technique to secure your site; Least Privileges - writing code to minimize access to the least needed for any particular user's needs; Simple is Beautiful - the writing of clear, simple code, to make troubleshooting and auditing easier; and Minimize Exposure - taking steps to design and implement programs to eliminate or at least minimize display of sensitive data or code - don't even store credit card information unless absolutely necessary, he suggests.

Next, comes "Best Practices" - balancing risk vs. usability, keeping track of data, filtering of all input, escaping output, and in all cases, distinguishing between filtered and tainted data. These principles and practices are illustrated with short code snippets comparing insecure vs. more secure code.

The next seven chapters deal with specific elements of a website, the types of attacks that can occur with each, and tips and suggestions on how to deal with these attacks. These elements include vulnerabilities in forms and URLs, databases and SQL, sessions and cookies, PHP "include" files, files and commands, authentication and authorization, and shared hosting.

The author credibly describes by examples the types of attacks against forms and URLs - cross-site scripting, cross site request forgeries, spoofing of forms, and insecure Raw HTTP requests. Authentication attacks include dictionary attacks, password sniffing, replay attacks, and cookie stealing. For each, he briefly describes how the attacks work, shows examples of insecure code, and provides examples of secure code.

For each of the elements dealt with, the author follows the same model: describe briefly the types of attacks against each element, show conventionally-used insecure code, and show how to eliminate the insecure parts of the code. Most of the security defenses entail filtering data from outside sources, especially form input, email, and XML documents from other web applications. Other defense techniques include using SSL for encrypted data transmissions, strengthening identification methods, hard-coding file paths, and using token techniques in addition to PHP encryption functions. Interestingly, Schiflett believes it is impossible to achieve a high level of security in a shared hosting situation. He provides suggestions on what security measures will help the most.

What is most useful about this book is the aggregation in one place of descriptions of all of these security attacks, and vulnerabilities in PHP code, along with suggestions on dealing with them. The organization of the material is good, however. I believe the author falls short in his code examples. There appears to be a disconnect between the descriptive text (which is clear enough) and the examples, which are not, at least to me, a novice in PHP. I could not readily follow the detailed code segments, although I could understand in principle what was going on.

Some of the code segments were barely explained and some were inadequately explained. The concepts of the attacking techniques were understandable, but the detailed implementations were not. There are a small handful of illustrations, but I found them too simplistic and inadequate. To be fair, this may be a failure of the reviewer. More experienced PHP folks may not complain about the presentations. For them, this book gives them what they need to know about handling the security aspects of their applications, but my guess is that it is the less accomplished coders who need the most help (although those same people are probably writing the types of applications and sites least likely to be targeted by miscreants.)

There are three short appendices presenting suggestions on how to configure a PHP installation to minimize weaknesses, suggestions about avoiding certain powerful PHP functions, especially system commands, to minimize risk, and a short segment on cryptography features in PHP.
Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)



 
16 of 17 people found the following review helpful:
5.0 out of 5 stars Essential Indeed, October 23, 2005
By R. Peake "cyberscribe" (Ojai, CA United States) - See all my reviews
(REAL NAME)   
This review is from: Essential PHP Security (Paperback)
This book helped me identify and report a critical security vulnerability in a commercial third party PHP application we were planning to deploy in a business-critical fashion. For that alone, it was worth its weight in gold.

This books is the antidoe to the common misperception that PHP applications fall short on security. With sparkling clarity, Chris demystifies dozens of attacks and provides both solid theoretical and practical bases for coding securely in PHP. Throughout his work as a PHP security consultant, and culminating in this book, Chris has defined the lexicon for web security -- telling us precisely what it means to filter input, and precisely what it means to escape output -- as well as when, how and why. This is nothing short of a defining work on web application security as it applies specifically to PHP.

While this book does not cover using encoders (like the Zend Encoder or IonCube Encoder) to heighten security in a plain-text scripting language, every other topic you would expect to be covered is treated -- above all -- with accuracy, and all in just over a hundred pages. Where other authors might potificte to fill pages, Chris crafted this book to live up to its title -- it is indeed essential, distilled, and precise. Therefore there is little excuse from this point on to not have read it at least once, and thumb through it from time to time when developing or auditing a PHP application. I intend to make it required reading in my department, and recommend it highly to colleagues in other companies developing web applications in PHP.
Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)



 
10 of 10 people found the following review helpful:
4.0 out of 5 stars Good overview of PHP security issues to date, November 22, 2005
By Sam J. Keen (Portland, OR US) - See all my reviews
(REAL NAME)   
This review is from: Essential PHP Security (Paperback)
This long awaited work from who many refer to as the guru of PHP security is finally out.

I must say though, when it arrived in the mail, I was a bit surprised by the package. Rather than the typical book box you get, it was in a padded envelope and upon opening the package I saw that the book was a mere 109 pages (with appendices starting on page 87).

As I began to read the book, I started to realize some of the reasons for the small size. Chris stays completely on topic with PHP security and doesn't meander into subjects such as Linux server administration and security, which other (larger) texts do to quite a large extent. I acually went to another PHP security text I had recenty read, and if I took out the sysadmin sections, it left about the same amount of pages as Chris's book. Also Chris's approach to PHP security seems to be a very 'keep it simple one'. He doesn't get into elaborate security frameworks and application layers. He simply defines a PHP security issue, and provides a strait forward and simple solution for the problem. I agree with this approach since over engineering a solution, breeds complexity and complexity can easily mask, you guessed it, "security issues".

I would say what I liked most about this book is that he brought to light the security concerns when running on a shared host. I think this topic if very often neglected on the majority of PHP security articles and texts even though many of us use shared hosting due to how cheep it is. Chris devotes an entire chapter to the situation and clearly explains the vast security risks that come with shared hosting and gives examples of how to mitigate the risks.

I would actually recommend this book to just about any PHP programmer for the simple fact that it is a great catalog of PHP security risks to date and offers simple solutions to counter those risks. Since it is a quick read it is an excellent way to quickly see if you have your bases covered when it come to security of your PHP app. Some of the examples are a bit brief, but the fact that you have read Chris's book and been alerted to the security issue is the real value in the end. You can always go to http://phpsec.org/ or other sites for expanded examples.

"Knowing is half the battle"
GI Joe
Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)


Share your thoughts with other customers: Create your own review
 
 
 
Most Recent Customer Reviews

5.0 out of 5 stars IT MAY BE SHORT, BUT SIZE DOESN'T MATTER!
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... Read more
Published 1 month ago by Glenn Hostetler

5.0 out of 5 stars Good for non-php too
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... Read more
Published 1 month ago by S. Wilson

2.0 out of 5 stars I wanted so much to love this book
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. Read more
Published 10 months ago by Castlebravo

4.0 out of 5 stars Opened my eyes!
While smaller than many O'Reilly titles the author wastes no time in helping the new PHP programmer write more secure code. Read more
Published 24 months ago by Leam Hall

1.0 out of 5 stars Overpriced
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. Read more
Published on January 3, 2007 by Brian E. Mcelaney

3.0 out of 5 stars Alright - not very meaty though
Alright - not very meaty. Overall I'm glad I read it though, as I picked up some useful nuggets.

==========
Update 2006-12-30 - I'd like to bump this up to four... Read more
Published on December 25, 2006 by Jonathan Aquino

5.0 out of 5 stars PHP Security is a HUGE topic
This book is essential for anyone starting out in PHP, but not only for them. It offers tips for almost any skill level, maybe you know some of the ways to keep your site secure... Read more
Published on September 26, 2006 by Matthew Keefe

5.0 out of 5 stars VERY VERY HIGHLY RECOMMENDED!!
Are you a developer who is writing insecure PHP code? If you are, then this book is for you! Author Chris Shiflett, has done an outstanding job of writing a practical book that... Read more
Published on June 12, 2006 by John R. Vacca

5.0 out of 5 stars Essential for the Beginner or Advanced PHP developer
As a very security conscious developer, I found this book to be a GREAT resource to my library. Though the book is short in length, it is very rich in content. Read more
Published on April 11, 2006 by Nate Klaiber

3.0 out of 5 stars Not Bad
This handy book fecth most recent popular attacks, and roughly coveres most general attacking means and how to secure your website. Read more
Published on April 7, 2006 by B_Reviewer

Only search this product's reviews



Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 


Active discussions in related forums
Search Customer Discussions
Search all Amazon discussions
   
Related forums


So You'd Like to...


Create a guide

Look for Similar Items by Category


Look for Similar Items by Subject


 
Feedback
If you need help or have a question for Customer Service, contact us.
Please log in if you would like to report this content as inappropriate? Click here
Do you believe that this item violates a copyright? Click here
Is there any other feedback you would like to provide?

Your comments can help make our site better for everyone.


Your Recent History

 (What's this?)

After viewing product detail pages or search results, look here to find an easy way to navigate back to pages you are interested in.