Advanced Minds

  • Decrease font size
  • Default font size
  • Increase font size
  • default color
  • red color
  • green color
FireBoard
Welcome, Guest
Please Login or Register.    Lost Password?
php sanitize html input PHP on the Rise (1 viewing) (1) Guests
Go to bottom Post Reply Favoured: 0
TOPIC: php sanitize html input PHP on the Rise
#2209
Dr. GroundAxe (Visitor)
Click here to see the profile of this user
Birthdate:
php sanitize html input PHP on the Rise  
PHP Development Becoming Increasingly Popular ,
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#2210
php sanitize html input PHP on the Rise  
Security is not generally a language function, it requires an intelligent programmer, coupled with sensible and defensive programming techniques. The moment anyone, as a developer, can leave his brain at the doorstep and not think about security in his application, architecture, uninitialized  variables, buffer overflows, logs, redundancy in his code to prevent unauthorized/accelerated access, etc. is the moment another .NET it does everything for me programmer is born? Languages should facilitate smart people's ideas, not deprecate them. ASP.NET on the other hand, most samples have relatively secure data_base_ code because they use the built-in parameter features of ADO.NET rather than simply concatenating strings like most PHP samples do. Samples are pedagogical tools, not meant to be copied verbatim except by clueless _script_ monkeys
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#2211
Tim Smith (Visitor)
Click here to see the profile of this user
Birthdate:
php sanitize html input PHP on the Rise  
This was posted earlier, but is relevant to this discussion. Things are not happy in the world of PHP security: <http://blog.php-security.org/archives/61-Retired-from-securityphp.net...
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#2212
Paul Bramscher (Visitor)
Click here to see the profile of this user
Birthdate:
php sanitize html input PHP on the Rise  
This was posted earlier, but is relevant to this discussion. Things are not happy in the world of PHP security: <http://blog.php-security.org/archives/61-Retired-from-securityphp.net... There are no specifics provided, and no ability to comment on the blog.   What are we supposed to do with this sort of FUD commentary? Actions speak louder than words.  If M$ is charging $50/year for Windows OneCare, that's a tacit acknowledgment that the OS
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#2213
Oliver Wong (Visitor)
Click here to see the profile of this user
Birthdate:
php sanitize html input PHP on the Rise  
Let's have the specifics on these PHP holes. http://www.heise-security.co.uk/news/82500 <quote While Esser feels that certain PHP functions are intrinsically unsafe (for example allow_url_fopen/allow_url_include) and should therefore be revised, many developers, including PHP specialists Zend, think that the security problems in PHP applications have simply been caused by inexperienced programmers. </quote http://developers.slashdot.org/article.pl?sid=06/12/14/0410240 <quote Here are the most common security problems you run into in PHP:     * magic_quotes: This adds slashes to all input so that you don't have to sanitize it before it gets inserted into SQL. The problem is that developers write their code with magic_quotes on, but don't realize that it's often turned off elsewhere, which leads to gaping holes.     * register_globals: Variables can be placed directly into the global namespace. If you don't explicitly set all variables before using them anything can be injected into them, which brings me on to:     * Only critical errors are reported: If you use a variable which isn't set it'll just return null, with no error (unless you specifically turn up the error_reporting level). This means that someone who isn't familiar with the problem won't know that a variable in their _script_ can be written to by anyone until it's being exploited, functions which you would expect to return an error and halt the _script_ if they fail can carry on without giving any indication of failure.     * fopen_urls: By default you can include _script_s hosted on other websites! This often makes remote PHP execution, which would otherwise require eval(), much easier.       Who would have thought <?php include($var.'/include.php'); ? will run any PHP on any server, anyhere? (The attack in the article above leveraged entry using this, coupled with register_globals.)     * Inconsistencies: What one function does can never be applied to what another function does; you can never assume anything with the PHP library and always have to keep a browser window with the PHP manual handy. Using a function without carefully reading up what it does, even when it's very similar to another function you're familiar with, is asking for trouble in PHP.       The same goes for just about everything; are you checking whether some input equals some harmless number before passing it on to a SQL query or the browser? Don't forget that (5 == 5 UNION SELECT secret FROM ... ), null == 0 == == false, a == 4 == true; generally you just have to be on your toes.     * Input checking is difficult: Do you want htmlentities() or htmlspecialchars() ? Have you remembered to strip_slashes() if magic_quotes is on? Remember the user can input arrays too, are you checking that the input isn't an array? Have you remembered to escape queries with mysql_real_escape_string() ? mysql_escape_string() doesn't account for the character set being used, and so isn't good enough, trying to escape input for yourself is also dangerous. What about null bytes? Remember that the user can input binary data; PHP allows null bytes, and will add a slash to them, but when you send a string with null bytes to some functions, but not others, the null bytes will be silently dropped leaving only slashes.       To check input in PHP you have to be absolutely rigorous and take no half measures, people who aren't aware of the dangers don't stand a chance. </quote http://blog.php-security.org/archives/61-Retired-from-securityphp.net... <quote I have realised that any attempt to improve the security of PHP from the inside is futile. The PHP Group will jump into your boat as soon you try to blame PHP's security problems on the user but the moment you criticize the security of PHP itself you become persona non grata. I stopped counting the times I was called immoral traitor for disclosing security holes in PHP or for developing Suhosin. For the ordinary PHP user this means that I will no longer hide the slow response time to security holes in my advisories. It will also mean that some of my advisories will come without patches available, because the PHP Security Response Team refused to fix them for months. It will also mean that there will be a lot more advisories about security holes in PHP. </quote     - Oliver
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#2214
php sanitize html input PHP on the Rise  
[snip various web related PHP gotchas] There you go, not only are they well documented but pretty easy to understand what needs to be done (or not done, whichever the case shall be) to remedy - examples are usually given that discuss the potential problems and resolutions. Except for the occasional buffer ovrrun (or other error in the compiled binary, which happens to most complex apps and are addressed by the language maintainers) all those _script_-sidde vulnerabilities are well within the realm of the average PHP coder to handle and can be attended to with a good function library or good coding practice.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop
905 wymiana linkow sprawdz autoryzacje no auth sprawdz autoryzacje
channel 8 news cuny opel hearts wall border diving work