sciencehook / csrf-xsrf
CSRF attack protection library
Requires
- php: ^7
Requires (Dev)
- codeclimate/php-test-reporter: ^0.4.4
- phpunit/phpunit: ^7
This package is auto-updated.
Last update: 2020-08-14 13:35:56 UTC
README
CSRF/ XSRF Security mini library for PHP applications. Embed and verify security tokens in forms without much hassle.
Table of Contents
Installation
Requirements:
PHP
This library is developed and tested on PHP 7.2. We do not know its backward compatibility. So, please test it before using it for PHP version less than 7.2.
Steps:
First, get Composer, if you don't already have it.
Next, run the following command in your terminal in PROJECT's directory:
composer require sciencehook/csrf-xsrf
Usage Examples
You can find the working examples in examples folder.
input_form.php is input form containing CSRF token and form_validation.php validates the token and proceeds accordingly.
Contribution
Please raise issues in case of any bugs or problems. To contribute, please create pull requests.
License
MIT License
Copyright (c) 2018 ScienceHook
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.