Board index   FAQ   Search  
Register  Login
Board index php forum :: PHP and MySQL Security PHP & MySQL Security

Note on a PHP Security

Security issues related to php and mysql usage. How to make your code secure? Security measures and configurations? It's all in here!

Moderators: macek, egami, gesf

Note on a PHP Security

Postby Alexei Kubarev » Fri Dec 31, 2004 10:06 am

This information has been taken from PHP.net:

-----------------------------------------------------------------------------

A Note on Security in PHP
[31-Dec-2004] PHP is a powerful and flexible tool. This power and flexibility comes from PHP being a very thin framework sitting on top of dozens of distinct 3rd-party libraries. Each of these libraries have their own unique input data characteristics. Data that may be safe to pass to one library may not be safe to pass to another.

A recent Web Worm known as NeverEverSanity exposed a mistake in the input validation in the popular phpBB message board application. Their highlighting code didn't account for double-urlencoded input correctly. Without proper input validation of untrusted user data combined with any of the PHP calls that can execute code or write to the filesystem you create a potential security problem. Despite some confusion regarding the timing of some unrelated PHP security fixes and the NeverEverSanity worm, the worm didn't actually have anything to do with a security problem in PHP.

When we talk about security in a web application we really have two classes. Remote and Local. Every remote exploit can be avoided with very careful input validation. If you are writing an application that asks for a user's name and age, check and make sure you are only getting characters you would expect. Also make sure you are not getting too much data that might overflow your backend data storage or whatever manipulation functions you may be passing this data to. A variation of the remote exploit is the XSS or cross-site scripting problem where one user enters some javascript that the next user then views.

For Local exploits we mostly hear about open_basedir or safemode problems on shared virtual hosts. These two features are there as a convenience to system administrators and should in no way be thought of as a complete security framework. With all the 3rd-party libraries you can hook into PHP and all the creative ways you can trick these libraries into accessing files, it is impossible to guarantee security with these directives. The Oracle and Curl extensions both have ways to go through the library and read a local file, for example. Short of modifying these 3rd-party libraries, which would be difficult for the closed-source Oracle library, there really isn't much PHP can do about this.

When you have PHP by itself with only a small set of extensions safemode and open_basedir are generally enough to frustrate the average bad guy, but for critical security situations you should be using OS-level security by running multiple web servers each as their own user id and ideally in separate jailed/chroot'ed filesystems. Better yet, use completely separate physical servers. If you share a server with someone you don't trust you need to realize that you will never achieve airtight security.

--------------------------------------------------------------------------

I recommend everyone to take a look at their configurations and security levels to minimize the chance of being hacked..
User avatar
Alexei Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Re: Note on a PHP Security

Postby farziali2000 » Wed May 04, 2011 6:12 pm

how can i secure my php applications?
i am new in php can you help to understand php?
farziali2000
New php-forum User
New php-forum User
 
Posts: 1
Joined: Wed May 04, 2011 6:07 pm

herve leger wedding dress cheapest Herve Leger on

Postby galloway8 » Wed May 15, 2013 7:30 pm

Let?s test your knowledge of important Cisco and CompTIA certification exam topics!
CCNA / CCENT / Network+ Exam:
A switch receives a frame with a unicast destination MAC, but the switch does not have an entry for that MAC in its bridging table. What term describes the default action of the switch?
A. flood
B. filter
C. unicast
D. drop
E. herve leger uk outlet unicast
Answer: A. The frame will be "flooded" - that is, sent out every port except the one it came in on.
Security+ Certification Exam:
A potential network intruder calls a helpdesk and pretends to be an employee of the herve leger dress price company in an attempt to get that employee?s password. What kind of network attack is this?
<br rihanna herve leger />Answer: This is a social engineering attack.
CCNP Certification / BSCI Exam:
Fill in the blank: ISIS assigns redistributed routes a metric of ____________.<br [url=/]herve leger bandage dress[/url] />
Answer: ISIS assigns redistributed routes a metric of 0.
CCNP Certification / BCMSN Exam:
A VTP switch has a revision number of herve leger 2012 collection 5. This switch receives a VTP advertisement with a revision number of 6. What action(s) [url=/]herve leger knockoff dresses[/url] will this switch take?
A. The switch will accept the advertisement.
B. The switch will reject the advertisement.
C. The switch will increment its revision number.
D. The switch will decrement its revision number.
Answers: A, C. The VTP switch will accept the advertisement; since the revision number of the ad is higher than its own, the advertisement is more recent. The switch will then increment its revision number by one.
CCNP Certification / ISCW Exam:
Which of the following queueing methods poses the greatest threat of TCP Global Synchronization?
A. CBWFQ
B. PQ
C. RED
D. WRED
Answer: A. CBWFQ uses Tail Drop as its default method of packet drop. In turn, Tail Drop can lead to TCP Global Synchronization.

Related articles:


herve leger cheapest Herve Leger on sale (5)

herve leger shop online cheapest Herve Leger on sale (10)

herve leger black bandage dress cheapest Herve Leg
galloway8
New php-forum User
New php-forum User
 
Posts: 127
Joined: Mon Jan 07, 2013 3:36 am


Return to PHP & MySQL Security

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.