1
ajaxbr
PHP Security help needed
  • 2005/2/10 2:13

  • ajaxbr

  • Quite a regular

  • Posts: 276

  • Since: 2003/10/25


Hi XOOPSers,
I'm trying to adapt a program that finds flaws in C/C++ code to PHP, so that we could have large scale automated (and somewhat dumb, but still worth IMHO) code security scans. The original app, Flawfinder, has a list of C/C++ functions that may create security issues, then a few functions to check whether the way a given 'flagged' function is used makes it safe or a problem.


I've built a list of functions (>3600, almost all at php.net) with short descriptions and links to the PHP Manual and will start picking the ones I find in PHP security articles, assigning arbitrary risk values and trying to prune false positives for them. My PHP security knowledge is very very small, so if you can contribute (like listing functions you think should be included and why), things could work a lot faster and better

So, in a nuts-hell , I need help to determine which core PHP functions bring security issues, what checks I could do to eliminate false-positives (i.e., safe ways of using flagged functions) and to rank the hits the program finds.

Sample output (for a pretty naive version, numbers between '[' and ']' would be risk rank, and you'll be able to limit scans for hits above rank X using command line options).

2
hervet
Re: PHP Security help needed
  • 2005/2/11 16:40

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Hello,

For what I know, much of the time, the problems are coming from the code itself and not from the Php functions.

Hervé

3
ajaxbr
Re: PHP Security help needed
  • 2005/2/11 19:55

  • ajaxbr

  • Quite a regular

  • Posts: 276

  • Since: 2003/10/25


Hi Herve,
Thanks for replying
What I`m trying to build is a scanner for bad code, using PHP functions as a start (but can and hopefully will go beyond that). So if you can share what kind of bad code I should look for, I`ll try to put it in As of now, things like "fopen($file)" are flagged, but it's still very far from useful.

Here`s a sample bit of output for a couple ranked functions:






Still a long way to go... but might work
looks good in preview, then borks on submit
When I get home I'll upload it then re-post...

4
hervet
Re: PHP Security help needed
  • 2005/2/19 10:07

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Hello ajaxbr,

Sorry to come back so later.
I have recovered a program I have found on internet. Php protector. It was made in C.

You will find, at this url, the source code and a compiled version for Windows (see the Release forlder).

It scans source code an try to find flaws.
Not a big program but it could help.

Bye,
Hervé

Login

Who's Online

233 user(s) are online (123 user(s) are browsing Support Forums)


Members: 0


Guests: 233


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits