Join Amazon Prime and ship Two-Day for free and Overnight for $3.99. Already a member? Sign in.
Essential PHP Security and over 300,000 other books are available for Amazon Kindle – Amazon’s new wireless reading device. Learn more

 

or
Sign in to turn on 1-Click ordering.
 
 
More Buying Choices
45 used & new from $8.98

Have one to sell? Sell yours here
 
   
Essential PHP Security
 
 
Start reading Essential PHP Security on your Kindle in under a minute.

Don’t have a Kindle? Get yours here.
 
  
3.8 out of 5 stars See all reviews (16 customer reviews)

List Price: $29.95
Price: $19.77 & eligible for FREE Super Saver Shipping on orders over $25. Details
You Save: $10.18 (34%)
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.

Want it delivered Wednesday, July 15? Choose One-Day Shipping at checkout. Details
29 new from $15.00 16 used from $8.98
Also Available in: List Price: Our Price: Other Offers:
Kindle Edition (Kindle Book) $14.39
Like this book? Find similar titles from O'Reilly and Partners in our O'Reilly Bookstore.

Best Value

Buy Essential PHP Security and get PHP Hacks: Tips & Tools For Creating Dynamic Websites at an additional 5% off Amazon.com's everyday low price.

Essential PHP Security + PHP Hacks: Tips & Tools For Creating Dynamic Websites
Buy Together Today: $38.55

Show availability and shipping details


Customers Who Bought This Item Also Bought

Apache Security

Apache Security

by Ivan Ristic
4.8 out of 5 stars (14)  $23.07
Pro PHP Security

Pro PHP Security

by Chris Snyder
3.9 out of 5 stars (7)  $39.49
PHP Cookbook (Cookbooks (O'Reilly))

PHP Cookbook (Cookbooks (O'Reilly))

by Adam Trachtenberg
4.5 out of 5 stars (39)  $29.69
Programming PHP

Programming PHP

by Rasmus Lerdorf
3.8 out of 5 stars (58)  $26.39
JavaScript: The Definitive Guide

JavaScript: The Definitive Guide

by David Flanagan
4.4 out of 5 stars (286)  $31.49
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
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.

See all Editorial Reviews


Product Details


Inside This Book (learn more)

What Do Customers Ultimately Buy After Viewing This Item?

Essential PHP Security
80% buy the item featured on this page:
Essential PHP Security 3.8 out of 5 stars (16)
$19.77
Pro PHP Security
7% buy
Pro PHP Security 3.9 out of 5 stars (7)
$39.49
Apache Security
6% buy
Apache Security 4.8 out of 5 stars (14)
$23.07
Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
3% buy
Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems 5.0 out of 5 stars (10)
$19.77

Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
Check the boxes next to the tags you consider relevant or enter your own tags in the field below.
(12)
(5)
(3)

Your tags: Add your first tag
 
Help others find this product — tag it for Amazon search
No one has tagged this product for Amazon search yet. Why not be the first to suggest a search for which it should appear?

 

Customer Reviews

16 Reviews
5 star:
 (7)
4 star:
 (2)
3 star:
 (5)
2 star:
 (1)
1 star:
 (1)
 
 
 
 
 
Average Customer Review
3.8 out of 5 stars (16 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
  

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 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 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

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 6 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 20 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

5.0 out of 5 stars Excellent PHP security overview
Provides a good practical overview of common website attacks and how to handle them. Each type of attack is explained before showing the defence. Read more
Published on February 8, 2006 by P. Brotherton

5.0 out of 5 stars Makes you think.
I found this book very helpful. The language is easy to understand and the examples are clear and concise. Read more
Published on December 5, 2005 by K. Haman

Only search this product's reviews



Customer Discussions

 Beta (What's this?)
New! See all customer communities, and bookmark your communities to keep track of them.
This product's forum (0 discussions)
  Discussion Replies Latest Post
  No discussions yet

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

   


Product Information from the Amapedia Community

Beta (What's this?)

Help us improve this fledgling article by editing it on Amapedia.com opens new browser window




Look for Similar Items by Category


Avon: Free Shipping

Avon Mark Just Pinched Instant Blush Tint
Get free shipping on all Avon orders of $25 or more. Shop Avon's award-winning makeup, skin care, bath & body items, and more.

Shop Avon now

 

Best Books of 2008

Best of 2008
Find our top 100 editors' picks as well as customers' favorites in dozens of categories in our Best Books of 2008 Store.
 

Grip It Good

Shop for Pliers
Pliers are a great tool to have around to help grip, turn, bend, or otherwise manipulate an object as needed.

Shop all pliers

 

Best Books

Best of the Month
See our editors' picks and more of the best new books on our Best of the Month page.
 

 

Feedback

If you need help or have a question for Customer Service, contact us.
 Would you like to update product info or give feedback on images?
Is there any other feedback you would like to provide?

Your comments can help make our site better for everyone.


Where's My Stuff?

Shipping & Returns

Need Help?

Your Recent History

  (What's this?)
You have no recently viewed items or searches.

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

Look to the right column to find helpful suggestions for your shopping session.

Continue shopping: Top Sellers
Paranoia
Paranoia by Joseph Finder
My Soul to Lose
My Soul to Lose by Rachel Vincent
Glenn Beck's Common Sense
Glenn Beck's Common Sense

Conditions of Use | Privacy Notice © 1996-2009, Amazon.com, Inc. or its affiliates