1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Top 10 PHP Security Blunders

Discussion in 'PHP' started by salahsoftware.com, Mar 4, 2009.

  1. #1
    PHP is probably the most common language now for Web development. Certainly PHP is a terrific language for the rapid development of dynamic Websites. It also has many features that are friendly to beginning programmers, such as the fact that it doesn't require variable declarations. However, many of these features can lead a programmer inadvertently to allow security holes to creep into a Web application. The popular security mailing lists teem with notes of flaws identified in PHP applications, however PHP can be as secure as any other language once you understand the basic types of flaws PHP applications tend to exhibit.

    "Security is a process, not a product, and adopting a sound approach to security during the process of application development will allow you to produce tighter, more robust code."

    Let's list the top 10 PHP Security Flaws here.
     
    salahsoftware.com, Mar 4, 2009 IP
  2. gary4gar

    gary4gar Peon

    Messages:
    496
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you forgot to post the link:p
     
    gary4gar, Mar 4, 2009 IP
  3. Kaizoku

    Kaizoku Well-Known Member

    Messages:
    1,261
    Likes Received:
    20
    Best Answers:
    1
    Trophy Points:
    105
    #3
    I don't think he can.
     
    Kaizoku, Mar 4, 2009 IP
  4. salahsoftware.com

    salahsoftware.com Peon

    Messages:
    249
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Please read the post properly. I asked everyone to identify and contribute.
     
    salahsoftware.com, Mar 5, 2009 IP
  5. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #5
    Is this a contribution??
     
    bartolay13, Mar 5, 2009 IP
  6. salahsoftware.com

    salahsoftware.com Peon

    Messages:
    249
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Please identify and list few security flaws of PHP.
     
    salahsoftware.com, Mar 5, 2009 IP
  7. crivion

    crivion Well-Known Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    160
    Digital Goods:
    3
    #7
    if you're talking about mistakes of php coders I would put Forms validation as a major security flaw
    From there troubles can start
     
    crivion, Mar 5, 2009 IP
  8. Kaizoku

    Kaizoku Well-Known Member

    Messages:
    1,261
    Likes Received:
    20
    Best Answers:
    1
    Trophy Points:
    105
    #8
    I see alot of people don't know how to access key arrays.

    $array['key'] NOT $array[key]

    To access it in a string, you need curly braces.

    $string = "This string has {$array['key']} value";
     
    Kaizoku, Mar 5, 2009 IP
  9. salahsoftware.com

    salahsoftware.com Peon

    Messages:
    249
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Well, I am talking about the security problem in php.
     
    salahsoftware.com, Mar 5, 2009 IP
  10. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I think salahsoftware is trying to get us to write an article for him!
     
    SmallPotatoes, Mar 5, 2009 IP
  11. Kaizoku

    Kaizoku Well-Known Member

    Messages:
    1,261
    Likes Received:
    20
    Best Answers:
    1
    Trophy Points:
    105
    #11
    PHP has no real security flaws, it is the person that coded will cause security flaws.
     
    Kaizoku, Mar 5, 2009 IP
  12. creativeGenius

    creativeGenius Well-Known Member

    Messages:
    273
    Likes Received:
    5
    Best Answers:
    1
    Trophy Points:
    120
    #12
    yep, the coder is always in charge of making everything as secure as possible
     
    creativeGenius, Mar 5, 2009 IP
  13. Shoro

    Shoro Peon

    Messages:
    143
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Not escaping user input before using it in an SQL query is the biggest one. The only other one I can think of would be people thinking that hashing something twice i.e. (sha1(md5('plaintext'))) makes the hash more secure, when it actually makes it less secure.
     
    Shoro, Mar 5, 2009 IP
  14. salahsoftware.com

    salahsoftware.com Peon

    Messages:
    249
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #14
    I list one, get_magic_quotes is a security issue.
     
    salahsoftware.com, Mar 6, 2009 IP
  15. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #15
    I wouldn't say get_magic_quotes_XXX is a security issue, it just tells you whether the horrible magic quotes feature is turned on.

    Magic quotes is more of an annoyance than a security issue, I think. Though it can create a false sense of security in the unfortunate event that it is turned on.
     
    SmallPotatoes, Mar 6, 2009 IP
  16. salahsoftware.com

    salahsoftware.com Peon

    Messages:
    249
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Access Control Flaws

    Another type of flaw that's not necessarily restricted to PHP applications, but is important nonetheless, is the access control type of vulnerability.
     
    salahsoftware.com, Mar 6, 2009 IP
  17. salahsoftware.com

    salahsoftware.com Peon

    Messages:
    249
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #17
    Session ID Protection

    Session ID hijacking can be a problem with PHP Websites. The PHP session tracking component uses a unique ID for each user's session, but if this ID is known to another user, that person can hijack the user's session and see information that should be confidential. Session ID hijacking cannot completely be prevented; you should know the risks so you can mitigate them.
     
    salahsoftware.com, Mar 6, 2009 IP
  18. dannywwww

    dannywwww Well-Known Member

    Messages:
    804
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    110
    #18
    Make sure input $_POST & $_GET are properly sanitized, and make sure variables are declared.
     
    dannywwww, Mar 6, 2009 IP
  19. salahsoftware.com

    salahsoftware.com Peon

    Messages:
    249
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #19
    what about $_SERVER?
     
    salahsoftware.com, Mar 6, 2009 IP
  20. jackio

    jackio Banned

    Messages:
    490
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #20
    If you sanitize all possible user entries ($_POST, $_GET, $_FILES, $_SERVER, etc.), declare and make sure that any additional data is inserted, keep in touch with the latest updates from php.net, check the right permissions, use salt encryption, you 'll make a possible attacker get more trouble getting into your website.
     
    jackio, Mar 7, 2009 IP