Reporting error in the Cpatcha module, when used on Account creation page.
No captcha, or recaptcha work:
sample error message in the logs for the mathematic challenge

post blocked by CAPTCHA module: challenge "Math" (by module "captcha"), user answered "6", but the solution was "fa178896c86c5f4ba5381adabfa2caa7".

The solution was really 6 ( I even checked with a calculator 2+4 LOL)

Note I had the same problem with the Alpha release.

Comments

soxofaan’s picture

this is related to #995260: CAPTCHA bypass with "undefined"

With "Account creation page" do you mean "example.com/user/register"?

do you also get this problem on other forms (like comment, node forms, ..)?

wallid’s picture

The error happens in /user/register.
I tested a captcha in the User Login Block and that worked without problem.

The user/register page I use has a custom fields (Date of birth using the date module).

Please let me know if you need more info

soxofaan’s picture

Does it work without the Date field?
Is the Date field doing any AJAX/AHAH maybe?

wallid’s picture

Hello,

sorry for the delay.

just tried the math captcha on the user registration form without the date field. and I get the same error:
post blocked by CAPTCHA module: challenge "Math" (by module "captcha"), user answered "19", but the solution was "4795a760b058ac1b7d67db0b5028c748".

For some reason on that form it does not encode the answer provided by the user (sha, md5 with salt maybe).
Tomorrow if I have some time I will do a vanilla install of Drupal 7 and captcha module and see if the error happens,
will update.
Thanks

Wallid

soxofaan’s picture

FYI: the CAPTCHA module does not encrypt the answer. The md5-like value is just a random initialization value stored as solution in the CAPTCHA session before a challenge is generated (and the real solution is known). So for some reason this initialization value isn't overwritten with the real solution. (Note this is all server side, before stuff is send to the client).

wallid’s picture

Status: Active » Closed (cannot reproduce)

Installed new drupal 7 instance and all modules same as the original installs.
added some fields to the user register page (date, long text, pictures, drop down etc) testing each time to see if it would break the captcha or the recaptcha (i tested both). ziltch, nada, not a single hick-up. it worked.

went back to the original set up, and started pulling fields to see if one of the fields was the culprit.
On the original site, apparently I can not have a pictures upload field (either custom or default), it breaks the captcha with the error mentioned above.
I have really no valid explanation as why this is happening. Without the captcha modules the user register page works without a problem and the user pics are uploaded and saved in the database.

Moving development to a new set up in the morning. Closing this issue as I can not duplicate.

Thanks

postscripter’s picture

So what now? does it mean we will have the same issue as long as we have the image upload???
I am having the exact same problem...

carsteng’s picture

any new progress???? I have the same issue because of image field on user profiles (Note: not shown in registration form). Captcha doesn't work on user/register Form. As a solution I get from this line of code always a md5 like value

$solution = db_query(
    'SELECT solution FROM {captcha_sessions} WHERE csid = :csid',
    array(':csid' => $csid)
    )
    ->fetchField();

I absolutely don't know why.... because there is no md5 like value in captcha_sessions solutions row.

soxofaan’s picture

Priority: Normal » Major
Status: Closed (cannot reproduce) » Active

I could reproduce this issue on an form with AJAX.

for example: a node add form with a field with unlimited values (so it has an "Add another item" button)

carsteng’s picture

I found out that this is related to http://drupal.org/node/1024370.

And there #9 worked out for me.

soxofaan’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.