|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Internet Security Discussion Forum This forum is for the discussion of security related issues. If you find a new Phishing scheme, spyware, virus or malicious site - let us know about it. If any of the above found you... here's where you ask for help. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
There's some good info here! Thanks!
I'm working on XSS fixes for a PHP website, and I'm working on fixing all pages where content is encoded for UTF-8, but the Meta tag specifies charset ISO-8859-1. Third, I'm searching for php_version at: http://www.saintcorporation.com/cgi-...=cve_2006.html to determine what fixes need to be applied. My question is: What do you think of Sohusin or the Hardened PHP Patch? It seems good, but the forums are dead as if no one is using it. I'm an ASP/.NET/PHP developer, and I'm supporting a PHP webform app that is riddled with XSS problems (according to Acunetix Web Vulnerability Scanner). I never got this deep into PHP security (unlike .NET). Any recommendations for me? |
|
||||
|
Yes, there are a lot of good libraries. Click the last link in my signature. In addition, I can recommend this
The PHP Anthology: 101 Essential Tips, Tricks & Hacks, 2nd Edition - SitePoint Books book. Note security is more related to the programmer than the language. General security advice: If you have the option to choose between usning a programming solution or a web server configuration, choose the last. It is on the lowest level and generally more secure. Web server security should be the first layer in any website. |
|
||||
|
Send form data with PHP
Var regex = new RegExp("string"); How it is done in JavaScript. Related: Using Regular Expressions in PHP [PHP & MySQL Tutorials] Regular Expressions in JavaScript [JavaScript & AJAX Tutorials] |
|
||||
|
You only need to consider three things when talking about secure php programming.
1. Data Input (session hijacking, sql injections, poisoned variables). 2. Data Output of Input (XSS-cross site scripting). 3. Server Side Security and php.ini 1. Session Hijacking Use a database to store session data, do not use the native session storage method as this can lead to hijacking and session fixation. SQL Injection Always use a databases native escaping routine such as mysql_real_escape_string() do not use addslashes() or stripslashes() as they do not take into consideration the language in use whereas mysql_real_escape_string() does. This stops all sql injection attacks dead in their tracks. Poisoned Variables Turn off register globals and initialize all your variables. If you use a variable $a then use $a=0 or $a="" at the top of your script, you never know when a host might enable globals so be safe, especially if your software is commercial. 2. Data output of Input Never ever directly echo() or print() input from $_GET, $_POST, $_COOKIE, $_REQUEST arrays. Always use htmlspecialchars and htmlentities to encode such data. 3. Server Security and php.ini You should disable the following function - urlfopen, exec, system, shell_exec, dl, passthru unless you specifically need them and run your own server. Install suphp or phpsuexec to have php scripts run under their users permissions. Kgun mentioned a good book, another is essential php security by Craig Shifflett. You should also take a look at his php security blog Chris Shiflett: PHP and Web Application Security
__________________
"I have not failed. I have found 10,000 ways that don't work" - Thomas Edison. "The secret to creativity is knowing how to hide your sources" - Albert Einstein. |
|
||||
|
Great and structured post.
Quote:
"The secret to creativity is knowing how to hide your sources" - Albert Einstein. Now I know why I am not creative. I am too open on my sources. The surfer is the boss.
__________________
Mini Network:: Financial information at your fingertips Learn object oriented programming where it started Last edited by kgun; 03-09-2008 at 07:29 AM. |
|
||||
|
Yep, same person, well there isnt two people just Chris Shiflett. Posted that in the morning without my coffee
__________________
"I have not failed. I have found 10,000 ways that don't work" - Thomas Edison. "The secret to creativity is knowing how to hide your sources" - Albert Einstein. |
|
|||
|
Great posts so far, just like to add a couple that may be of interest
PHP Security Consortium - Shame its not been updated for a while but still a worthwhile lead The Unexpected SQL Injection - Detailed paper on SQL injection and some specific examples for PHP / Mysql PHP Developers Network - Security forum on PHP developers network, has a number of links to other useful documents Hopefully someone will find these links useful |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Security Certifications | MrGamm | Internet Security Discussion Forum | 9 | 03-02-2008 09:02 AM |
| PHP Security | seo111hello | Internet Security Discussion Forum | 0 | 08-02-2007 02:17 AM |
| Need a Security Scorecard? | WPW_Feedbot | IT Discussion Forum | 0 | 04-06-2005 03:31 PM |
| Web Server Security | emi_b | IT Discussion Forum | 7 | 06-25-2004 07:14 PM |
| Security | shawc | Web Programming Discussion Forum | 1 | 06-01-2004 03:20 PM |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |