Re: setcookie security concerns

From: Date: Wed, 15 Mar 2006 15:08:01 +0000
Subject: Re: setcookie security concerns
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-231944@lists.php.net to get a copy of this message
An interesting question in this case is how to do an injection using cookies, injection attacks are generally performed using post & get data as they can be inserted to a link on another page. Getting a working exploit would probably come down to how the browser implemented the cookie security; who can set cookies where. Regardless, it's not worth the risk. Checking for valid values or using htmlentities to make the variable safe is a quick and simple solution. Getting into the practice of screening all user data either manually or using the input_filter extension will also save you from these problems in the future. David
David: I thank you for your explanation. I experienced an injection attack on a php-form I wrote/provided where someone entered an incomplete html tag that created problems for the form. So, I realize the potential, I just don't know the scope of those types of problems and that was one of the reasons why I asked about this specific cookie issue. What could a hacker do by injecting whatever into a cookie that resides client-side on his computer? tedd ps: With the form, I solved it by using htmlentities -- -------------------------------------------------------------------------------- http://sperling.com

« previous php.general (#231944) next »