Welcome our webmaster and SEO forum
Please enjoy the forum, contribute what you can, and wind up the Moderators!
Results 1 to 4 of 4

Thread: PHP Security <- A MUST READ

  1. #1
    Alexandru Ungur is offline Senior Member
    Join Date
    Aug 2004
    Posts
    165

    Default PHP Security <- A MUST READ

    For those of you that don't constantly check out php.net site for news, here's a must read one:

    source:
    php.net/security-note.php

    --- copy &amp; paste ---
    A Note on Security in PHP

    PHP is a powerful and flexible tool. This power and flexibility comes from PHP being a very thin framework sitting on top of dozens of distinct 3rd-party libraries. Each of these libraries have their own unique input data characteristics. Data that may be safe to pass to one library may not be safe to pass to another.

    A recent Web Worm known as NeverEverSanity exposed a mistake in the input validation in the popular phpBB message board application. Their highlighting code didn't account for double-urlencoded input correctly. Without proper input validation of untrusted user data combined with any of the PHP calls that can execute code or write to the filesystem you create a potential security problem. Despite some confusion regarding the timing of some unrelated PHP security fixes and the NeverEverSanity worm, the worm didn't actually have anything to do with a security problem in PHP.

    When we talk about security in a web application we really have two classes. Remote and Local. Every remote exploit can be avoided with very careful input validation. If you are writing an application that asks for a user's name and age, check and make sure you are only getting characters you would expect. Also make sure you are not getting too much data that might overflow your backend data storage or whatever manipulation functions you may be passing this data to. A variation of the remote exploit is the XSS or cross-site scripting problem where one user enters some javascript that the next user then views.

    For Local exploits we mostly hear about open_basedir or safemode problems on shared virtual hosts. These two features are there as a convenience to system administrators and should in no way be thought of as a complete security framework. With all the 3rd-party libraries you can hook into PHP and all the creative ways you can trick these libraries into accessing files, it is impossible to guarantee security with these directives. The Oracle and Curl extensions both have ways to go through the library and read a local file, for example. Short of modifying these 3rd-party libraries, which would be difficult for the closed-source Oracle library, there really isn't much PHP can do about this.

    When you have PHP by itself with only a small set of extensions safemode and open_basedir are generally enough to frustrate the average bad guy, but for critical security situations you should be using OS-level security by running multiple web servers each as their own user id and ideally in separate jailed/chroot'ed filesystems. Better yet, use completely separate physical servers. If you share a server with someone you don't trust you need to realize that you will never achieve airtight security.

  2. #2
    ovi Guest

    Default ;)

    Very nice the article, thanks Alex

    Ovi

  3. #3
    Lanre Guest

    Default

    Thanks Alex,

    I'm sure not too many people goes to the site unless they need some form of info or download.

  4. #4
    Alexandru Ungur is offline Senior Member
    Join Date
    Aug 2004
    Posts
    165

    Default

    Quote Originally Posted by Lanre
    Thanks Alex,

    I'm sure not too many people goes to the site unless they need some form of info or download.
    If they're developers they should....

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Why I was fired - READ THE TEXT FIRST
    By gkd_uk in forum Off topic
    Replies: 6
    Last Post: 07-23-2007, 09:27 PM
  2. Interesting Read.
    By midlandi in forum General Webmaster Talk
    Replies: 0
    Last Post: 01-19-2007, 09:28 PM
  3. PM Read Receipts
    By Duke in forum General Webmaster Talk
    Replies: 1
    Last Post: 08-22-2005, 08:16 AM
  4. A MUST read!
    By Paul_KY in forum General Webmaster Talk
    Replies: 7
    Last Post: 09-06-2004, 04:16 PM
  5. Read the rules please
    By ovi in forum General Webmaster Talk
    Replies: 0
    Last Post: 08-13-2004, 02:13 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124