Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Security-Basics
[Top] [All Lists]

Re: magic_quotes

Subject: Re: magic_quotes
Date: Mon, 27 Jun 2005 03:46:25 +0200
maarten@webfauna.com wrote:

I agree that magic quotes is not a very nice solution. Although 
it makes it a little harder to manipulate queries, it will
make your code less clear. Some strings in you application are
escaped (from POST data) and some are not (e.g. from database.) 
Sometimes it's not completly clear what the origin of a
variable (string) is.

FACK. Additional, magic_quotes are not reliable (some hosters deactivate
that) and it could be easily forget, that a application relies on
magic_quotes_*.

So let Applications not rely on things, which can be easily switched off
(e.g. safe_mode, open_basedir, automagic session_start, etc.) - not only
for security reasons.

I think it's easier and safer if you can concider all 
strings to be unescaped and make sure you escape them in a query.

I think, it's most important to check every piece of data, which is not
defined in the skript itself (including includes). This leads to be
thrifty with data (KISS).

You need clear and easy to understand code to make your application secure. 

FACK. KISS is very important in buildung secure applications.

In this case, I'd also use the intval() function. If you want an 
integer value, this makes sure it is.

Another way ist looking if data is valid (e.g. with reg exp) and handle
violations as errors (and handle errors adequate, too). Sometimes, this
violations can be esteemed as threat. But it's a case-by-case decition
and no general advice.

Greetings,
Chris

<Prev in Thread] Current Thread [Next in Thread>