Essential PHP Security and over 400,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.
 
 
Express Checkout with PayPhrase
What's this? | Create PayPhrase
More Buying Choices
40 used & new from $8.00

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 your Kindle here.
 
  
3.9 out of 5 stars  See all reviews (18 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%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.

Want it delivered Wednesday, February 10? Choose One-Day Shipping at checkout. Details
26 new from $9.99 14 used from $8.00

Formats

Amazon Price New from Used from
Kindle Edition $14.39  
Paperback $19.77  
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: $40.54

Show availability and shipping details


Customers Who Bought This Item Also Bought

Apache Security

Apache Security

by Ivan Ristic
4.7 out of 5 stars (15)  $23.07
PHP Hacks: Tips & Tools For Creating Dynamic Websites

PHP Hacks: Tips & Tools For Creating Dynamic Websites

by Jack D. Herrington
4.4 out of 5 stars (17)  $21.86
PHP Cookbook: Solutions and Examples for PHP Programmers

PHP Cookbook: Solutions and Examples for PHP Programmers

by David Sklar
4.5 out of 5 stars (42)  $29.69
Pro PHP Security

Pro PHP Security

by Chris Snyder
3.9 out of 5 stars (7)  $32.03
Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems

by Brian Ward
4.6 out of 5 stars (16)  $19.77
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.


Product Details

  • Paperback: 128 pages
  • Publisher: O'Reilly Media; 1 edition (October 13, 2005)
  • Language: English
  • ISBN-10: 059600656X
  • ISBN-13: 978-0596006563
  • Product Dimensions: 9.1 x 6.9 x 0.4 inches
  • Shipping Weight: 8 ounces (View shipping rates and policies)
  • Average Customer Review: 3.9 out of 5 stars  See all reviews (18 customer reviews)
  • Amazon.com Sales Rank: #215,763 in Books (See Bestsellers in Books)

    Popular in these categories: (What's this?)

    #53 in  Books > Computers & Internet > Business & Culture > Security
    #59 in  Books > Computers & Internet > Databases > Specific Databases > MySQL & mSQL
    #66 in  Books > Computers & Internet > Web Development > Programming > PHP

More About the Author

Chris Shiflett
Discover books, learn about writers, read author blogs, and more.

Visit Amazon's Chris Shiflett Page

Inside This Book (learn more)

What Do Customers Ultimately Buy After Viewing This Item?

Essential PHP Security
75% buy the item featured on this page:
Essential PHP Security 3.9 out of 5 stars (18)
$19.77
Pro PHP Security
10% buy
Pro PHP Security 3.9 out of 5 stars (7)
$32.03
PHP and MySQL Web Development (4th Edition)
6% buy
PHP and MySQL Web Development (4th Edition) 4.4 out of 5 stars (214)
$34.64
Apache Security
5% buy
Apache Security 4.7 out of 5 stars (15)
$23.07

Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
 
(14)
(5)
(3)

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

 
35 of 37 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.
Help other customers find the most helpful reviews  
Was this review helpful to you? Yes No


 
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.
Help other customers find the most helpful reviews  
Was this review helpful to you? Yes No


 
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
Help other customers find the most helpful reviews  
Was this review helpful to you? Yes No

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 4 months 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 4 months 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 13 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 on November 16, 2007 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
 

Search Customer Discussions
Search all Amazon discussions
   


Listmania!


So You'd Like to...


Create a guide

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


Look for Similar Items by Subject

 

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.


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.