Is PHP secure?
Author
Discussion

FunkyGibbon

Original Poster:

3,863 posts

294 months

Friday 7th April 2006
quotequote all
We run a prototyping IIS web server (much to the chagrin of the IT department) that has PHP running. I've just been given the heads up from the IT Manager that a security penetration test has flagged the PHP server a posing a security risk and he may shut it down.

Now, rather unhelpfully, he has not passed on the details of the problem.

So, is PHP inherently any less secure than other web dev apps (Cold Fusion, ASP etc)?

I suspect (hope) that the problem lies with the security of the IIS installation rather than anything specfic to PHP.

Any advice most welcome.

TIA

FG

JamieBeeston

9,294 posts

295 months

Friday 7th April 2006
quotequote all
PHP in itself isnt insecure, but applications written for / in PHP certainly can be.

There will always be bugs with any language which, with a modicum of sense and access to google, any kiddy can exploit over time.

I am sure 25%+ of the worlds internet servers run PHP

The solution is to keep ontop of upgrades.

J

tinman0

18,231 posts

270 months

Friday 7th April 2006
quotequote all
FunkyGibbon said:
So, is PHP inherently any less secure than other web dev apps (Cold Fusion, ASP etc)?


it can be insecure but the latest versions are pretty darn good.

the reason its flagged as a security issue is because its free. non of the corporates make money from it so they pretend its evil, unlike the commercial equivalents.

mr_yogi

3,288 posts

285 months

Friday 7th April 2006
quotequote all
We are moving to PHP for our systems at work and I have been on a few courses, the one thing the trainer kept saying was that PHP is enormously configurable (maybe too configurable for it's own good) and out of the box (i.e standard installation) it is VERY insecure. However once properly set up it is very secure.

An example he used was to make all files in the webserver directory processed by the PHP engine. If you don't and a dev miss types the extension of the file or people are snooping around for included files and the like, the whole file will be passed to the browser as html and thus the user can view the source. This may contain passwords and clues to tables etc. in the databases which could be used for an attack. If they are all processed by the PHP engine all files will only send HTML tags to the browser.

aldi

9,288 posts

267 months

Friday 7th April 2006
quotequote all
He´l have downloaded some random network scanner and will be quoting the results without any real understanding of what they mean... or am I just being cynical

FunkyGibbon

Original Poster:

3,863 posts

294 months

Friday 7th April 2006
quotequote all
tinman0 said:

the reason its flagged as a security issue is because its free. non of the corporates make money from it so they pretend its evil, unlike the commercial equivalents.


that was exactly my initial thought too, just because it ain't micro$oft and cost 30K a year for a licence it must be a security threat.

FunkyGibbon

Original Poster:

3,863 posts

294 months

Friday 7th April 2006
quotequote all
aldi said:
He´l have downloaded some random network scanner and will be quoting the results without any real understanding of what they mean... or am I just being cynical

just a cynical as moi

>> Edited by FunkyGibbon on Friday 7th April 18:49

m12_nathan

5,138 posts

289 months

Saturday 8th April 2006
quotequote all
FunkyGibbon said:
tinman0 said:

the reason its flagged as a security issue is because its free. non of the corporates make money from it so they pretend its evil, unlike the commercial equivalents.


that was exactly my initial thought too, just because it ain't micro$oft and cost 30K a year for a licence it must be a security threat.


Except that asp & asp.net don't cost anything to serve once you have an IIS server?

bga

8,134 posts

281 months

Saturday 8th April 2006
quotequote all
there are some complete muppets doing pen testing (and a lot of skilled people). I would ask to see the report and ensure that they have detailed and quantified the risks of running PHP (or a.n.other service). If they haven't done this then it's not worth the paper it's written on.

This way you have the opportunity to go through them and identifying mitigating controls or to challenge their findings.

_dobbo_

14,619 posts

278 months

Monday 10th April 2006
quotequote all
Something to consider if you feel that a system may be exposed is to firewall the system in question, then use a reverse proxy server on the DMZ to allow access.

This way it's extremelyunlikely that the PHP (or whatever) system will be compromised and if the reverse proxy is, it's on the DMZ and has no data on it anyway.

FunkyGibbon

Original Poster:

3,863 posts

294 months

Monday 10th April 2006
quotequote all
found out what the security threat was:

The only public page on the server (rest is protected by IP or username/password) is a test PHP page that displays the server environment variables and the setup parameters. This has now been removed.

FG

rich1231

17,340 posts

290 months

Monday 10th April 2006
quotequote all
FunkyGibbon said:
found out what the security threat was:

The only public page on the server (rest is protected by IP or username/password) is a test PHP page that displays the server environment variables and the setup parameters. This has now been removed.

FG

So you had only recently set ti up and left the default config page up?

Everyone does that.. a few times.

JamieBeeston

9,294 posts

295 months

Monday 10th April 2006
quotequote all
PHPinfo isnt actually left there be default, so someone must've actually put it there to test

<?phpinfo()?>

J

FunkyGibbon

Original Poster:

3,863 posts

294 months

Tuesday 11th April 2006
quotequote all
JamieBeeston said:
PHPinfo isnt actually left there be default, so someone must've actually put it there to test

<?phpinfo()?>

J


Indeed - it was put there and left there by the IT man who is now complaining we have an insecure system.

ErnestM

11,621 posts

297 months

Tuesday 11th April 2006
quotequote all
Which version of PHP are you using? Some versions are more secure than others. Of course if you protect the directory you should have limited (if any) problems...

ErnestM

FunkyGibbon

Original Poster:

3,863 posts

294 months

Tuesday 11th April 2006
quotequote all
ErnestM said:
Which version of PHP are you using? Some versions are more secure than others. Of course if you protect the directory you should have limited (if any) problems...

ErnestM


PHP Version 5.0.5

ErnestM

11,621 posts

297 months

Wednesday 12th April 2006
quotequote all
FunkyGibbon said:
ErnestM said:
Which version of PHP are you using? Some versions are more secure than others. Of course if you protect the directory you should have limited (if any) problems...

ErnestM


PHP Version 5.0.5



You're fine. As long as you have a well secured web server you should have a minimum (if any) of issues.

ErnestM

FunkyGibbon

Original Poster:

3,863 posts

294 months

Wednesday 12th April 2006
quotequote all
ErnestM said:
FunkyGibbon said:
ErnestM said:
Which version of PHP are you using? Some versions are more secure than others. Of course if you protect the directory you should have limited (if any) problems...

ErnestM


PHP Version 5.0.5



You're fine. As long as you have a well secured web server you should have a minimum (if any) of issues.

ErnestM

cheers!