Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: prevent forbidden characters in captcha id and double use of captcha #36

Merged
merged 10 commits into from
Jan 6, 2025

Conversation

mkrasselt1
Copy link

@mkrasselt1 mkrasselt1 commented Aug 12, 2024

Solves this bug:
Closes #13
and another one where attackers could just resend the last captcha over and over again, until the expiration period has passed.
Thats not what i would expect a captcha class to allow

BREAKING CHANGE:
prevents double sending of captchas - invalidates them after successful validation by regeneration of words

@froschdesign froschdesign added Bug Something isn't working Unit Test Needed labels Aug 14, 2024
@froschdesign
Copy link
Member

@mkrasselt1
First: Thank you for your time and this contribution! 👍

Your changes would also have to be tested accordingly. Could you add the tests?

@mkrasselt1
Copy link
Author

I can an I will :)
(never worked with tests bevore but I will figure it out :))

@mkrasselt1
Copy link
Author

Your changes would also have to be tested accordingly. Could you add the tests?

added two tests, should cover both new functions (reuse and id-injection)

@mkrasselt1
Copy link
Author

are my tests sufficient ?

@froschdesign froschdesign added this to the 2.18.0 milestone Jan 3, 2025
@samsonasik
Copy link
Member

Let's give it a try, thank you @mkrasselt1

@samsonasik samsonasik merged commit 4c0965b into laminas:2.18.x Jan 6, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

$value['id'] is not validated against invalid characters
3 participants