While i am using ajax dependant dropdown with captcha (form API).
while populating dropdown it will also return an error.

"CAPTCHA session reuse attack detected."

can any one help me out.
I already use patch http://drupal.org/files/1395184-11-captcha-ajax.patch
doesn't recover me out.

#4 warning captcha.png44.03 KBwas.uthm
captcha.jpg112.27 KBvimalgoradiya
Members fund testing for the Drupal project. Drupal Association Learn more


soxofaan’s picture

frompasttofuture’s picture

This question,I have solved, but my method isn't a very good way,because my client don't allow me to alter this captcha module, so i have to alter my custom my module,you can reference my method:


//  my this function name is ---------: custom_init
function yourmodulename_init() {
	$posted_captcha_sid = $_POST['captcha_sid'];
    $expected_captcha_token = db_query(
    "SELECT token FROM {captcha_sessions} WHERE csid = :csid",
       array(':csid' => $posted_captcha_sid)
	$_POST['captcha_token'] = $expected_captcha_token;
	$_POST['debug_captcha_token'] = $expected_captcha_token;


//  my this function name is ---------: user_login_custom_validate
function yourform_validate($form, &$form_state){
		$posted_captcha_sid = $_POST['captcha_sid'];
		$expected_captcha_token = $_POST['debug_captcha_token'];
		$token_ret = db_update('captcha_sessions') 
		  'token' => $expected_captcha_token,
		->condition('csid', $posted_captcha_sid, '=')
was.uthm’s picture

I use 7.x.1.0-beta2 but I have warning
CAPTCHA session reuse attack detected after uploading file

Here the problem

file 1 upload
CAPTCHA session reuse attack detected
file2 upload

I don't know how to fix it.Comment #2 is not clear to me as a beginner.

was.uthm’s picture

44.03 KB

I am sorry, forgot to attach

was.uthm’s picture

I have found the discussion here

although applying patch captcha-patch-10022012.patch is not clean
but I don't have any problem with "CAPTCHA session reuse attack detected"

Liam Morland’s picture