Code Monkey home page Code Monkey logo

php-cs-bouncer's Introduction

php-cs-bouncer's People

Contributors

alteredcoder avatar blotus avatar dependabot-preview[bot] avatar dependabot[bot] avatar julienloizelet avatar mobula9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-cs-bouncer's Issues

Do not use session anymore

The lib is using session to manage captcha interactions (is resolved, etc.) with the final user.

But, this session management can cause a lot of trouble (break login process, conflict with other session_start piece of code, etc.).

See for example :

To definitely avoid this kind of trouble, we could use another mechanism to manage the storage of these captcha interactions.

As we are already using a cache mechanism to store crowdsec decision for an IP, maybe we could use this cache to store the captcha interactions.

php 8.1 (captcha) Implicit conversion from float to int loses precision

With PHP 8.1, an error is thrown when a captcha wall has to be displayed.
On my local environment, here is the error :

Fatal error: Uncaught CrowdSecBouncer\BouncerException: Implicit conversion from float 15.5 to int loses precision in /var/www/html/my-own-modules/crowdsec-php-lib/src/StandAloneBounce.php:346 Stack trace: #0 [internal function]: CrowdSecBouncer\StandAloneBounce->CrowdSecBouncer\{closure}(8192, 'Implicit conver...', '/var/www/html/m...', 365) #1 /var/www/html/my-own-modules/crowdsec-php-lib/vendor/gregwar/captcha/src/Gregwar/Captcha/CaptchaBuilder.php(365): imagettftext(Object(GdImage), 27, -6, 15.5, 36, 6120063, '/var/www/html/m...', 'N') #2 /var/www/html/my-own-modules/crowdsec-php-lib/vendor/gregwar/captcha/src/Gregwar/Captcha/CaptchaBuilder.php(459): Gregwar\Captcha\CaptchaBuilder->writePhrase(Object(GdImage), 'NVEQO', '/var/www/html/m...', 150, 40) #3 /var/www/html/my-own-modules/crowdsec-php-lib/src/Bouncer.php(227): Gregwar\Captcha\CaptchaBuilder->build() #4 /var/www/html/my-own-modules/crowdsec-php-lib/src/AbstractBounce.php(181): CrowdSecBouncer\Bouncer::buildCaptchaCouple() #5 /var/www/html/my-own-modules/crowdsec-php-lib/src/AbstractBounce.php(246): CrowdSecBouncer\AbstractBounce->storeNewCaptchaCoupleInSession() #6 /var/www/html/my-own-modules/crowdsec-php-lib/src/AbstractBounce.php(267): CrowdSecBouncer\AbstractBounce->handleCaptchaRemediation('172.21.0.1') #7 /var/www/html/my-own-modules/crowdsec-php-lib/src/AbstractBounce.php(124): CrowdSecBouncer\AbstractBounce->handleRemediation('captcha', '172.21.0.1') #8 /var/www/html/my-own-modules/crowdsec-php-lib/src/AbstractBounce.php(60): CrowdSecBouncer\AbstractBounce->bounceCurrentIp() #9 /var/www/html/my-own-modules/crowdsec-php-lib/src/StandAloneBounce.php(348): CrowdSecBouncer\AbstractBounce->run() #10 /var/www/html/my-own-modules/crowdsec-php-lib/examples/auto-prepend/scripts/bounce-via-auto-prepend.php(14): CrowdSecBouncer\StandAloneBounce->safelyBounce() #11 {main} thrown in /var/www/html/my-own-modules/crowdsec-php-lib/src/StandAloneBounce.php on line 346

It seems that this is due to the gregwar/captcha package:

@see Gregwar/Captcha#100

I'm not sure that the package is still being maintained.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.