PHP Classes

demo.php bug

Recommend this page to a friend!

      Very Simple Captcha  >  All threads  >  demo.php bug  >  (Un) Subscribe thread alerts  
Subject:demo.php bug
Summary:Security breach in demo.php
Messages:1
Author:Felix Manea
Date:2007-09-26 08:18:48
 

  1. demo.php bug   Reply   Report abuse  
Picture of Felix Manea Felix Manea - 2007-09-26 08:18:48
in demo.php replace the following line:

if($_POST['key'] == $_SESSION['key']) {

with

if(strlen($_SESSION['key']) > 0 && $_POST['key'] == $_SESSION['key']) {

because if I submit a form using curl and never have generated the captcha code I will have an empty $_SESSION['key'], which will create $_POST['key'] == $_SESSION['key'] to be valid.

I have used this class and had the specified problem.

Also thank you for posting this class, its really simple to use and very ingenous.