You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libs/README.md
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,6 @@ CSRFProtector configuration
2
2
==========================================
3
3
4
4
-`CSRFP_TOKEN`: name of the csrf nonce, used for cookie or posting as argument. default: `CSRFP-Token` (if left blank)
5
-
-`logDirectory`: location of the directory at which log files will be saved, either **relative** to the default `config.php` file location or an **absolute** path. This is required for file based logging (default), Not needed, in case you override logging function to implement your logging logic. (View [Overriding logging function](https://github.com/mebjas/CSRF-Protector-PHP/wiki/Overriding-logging-function))
6
-
<br>**Default value:**`../log/`
7
5
-`failedAuthAction`: Action code (integer) for action to be taken in case of failed validation. Has two different values for bot `GET` and `POST`. Different action codes are specified as follows, (<br>**Default:**`0` for both `GET` & `POST`):
8
6
*`0` Send **403, Forbidden** Header
9
7
*`1`**Strip the POST/GET query** and forward the request! unset($_POST)
Copy file name to clipboardExpand all lines: libs/config.sample.php
+2-4Lines changed: 2 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -2,14 +2,12 @@
2
2
/**
3
3
* Configuration file for CSRF Protector
4
4
* Necessary configurations are (library would throw exception otherwise)
5
-
* ---- logDirectory
6
5
* ---- failedAuthAction
7
6
* ---- jsUrl
8
7
* ---- tokenLength
9
8
*/
10
9
returnarray(
11
-
"CSRFP_TOKEN" => "",
12
-
"logDirectory" => "../log",
10
+
"CSRFP_TOKEN" => "",
13
11
"failedAuthAction" => array(
14
12
"GET" => 0,
15
13
"POST" => 0),
@@ -26,5 +24,5 @@
26
24
"disabledJavascriptMessage" => "This site attempts to protect users against <a href=\"https://www.owasp.org/index.php/Cross-Site_Request_Forgery_%28CSRF%29\">
27
25
Cross-Site Request Forgeries </a> attacks. In order to do so, you must have JavaScript enabled in your web browser otherwise this site will fail to work correctly for you.
28
26
See details of your web browser for how to enable JavaScript.",
<br>CSRF protector php, a standalone php library for csrf mitigation in web applications. Easy to integrate in any php web app.
5
5
6
-
Add to your project using packagist
7
-
==========
6
+
# Add to your project using packagist
8
7
Add a `composer.json` file to your project directory
9
8
```json
10
9
{
@@ -16,61 +15,60 @@ Add to your project using packagist
16
15
Then open terminal (or command prompt), move to project directory and run
17
16
```shell
18
17
composer install
19
-
```
20
-
OR
21
-
```
18
+
19
+
## Or alternatively
20
+
22
21
php composer.phar install
23
22
```
24
-
This will add CSRFP (library will be downloaded at ./vendor/owasp/csrf-protector-php) to your project directory. View [packagist.org](https://packagist.org/) for more help with composer!
23
+
This will add CSRFP (library will be downloaded at `./vendor/owasp/csrf-protector-php`) to your project directory. View [packagist.org](https://packagist.org/) for more help with composer!
25
24
26
-
Configuration
27
-
==========
25
+
# Configuration
28
26
For composer installations: Copy the config.sample.php file into your root folder at config/csrf_config.php
29
27
For non-composer installations: Copy the `libs/csrf/config.sample.php` file into `libs/csrf/config.php`
30
28
Edit config accordingly. See Detailed Information link below.
31
29
32
30
[Link to wiki - Editing Configurations & Mandatory requirements before using this library](https://github.com/mebjas/CSRF-Protector-PHP/wiki/Configurations)
This version (`master`) requires the clients to have Javascript enabled. However if your application can work without javascript & you require a nojs version of this library, check our [nojs version](https://github.com/mebjas/CSRF-Protector-PHP/tree/nojs-support)
58
-
59
-
## Discussion
46
+
## Discussions
60
47
Join Discussions at [Google Group \ OWASP \ CSRF Protector](https://groups.google.com/a/owasp.org/forum/#!forum/csrfprotector-project)
61
48
62
-
~~Join Discussions on the [mailing list](https://lists.owasp.org/mailman/listinfo/owasp-csrfprotector)~~
Well, there are various ways to contribute to this project. Find few of them listed below:
52
+
### General steps
53
+
- Fork the repo
54
+
- Create your branch
55
+
- Commit your changes
56
+
- Create a pull request
57
+
58
+
### More?
59
+
Well, there are various ways to contribute to this project. Find a few of them listed below:
68
60
- Found a bug? Raise a bug in [the issue page](https://github.com/mebjas/CSRF-Protector-PHP/issues?q=is%3Aissue+is%3Aopen+label%3Abug). Please make sure it's not a duplicate of an existing issue.
69
-
- Have a feature request? Raise one at [the issue page](https://github.com/mebjas/CSRF-Protector-PHP/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement). As mentioned above please do a basic check if this `enhancement`exist in mentioned link.
61
+
- Have a feature request? Raise one at [the issue page](https://github.com/mebjas/CSRF-Protector-PHP/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement). As mentioned above please do a basic check if this `enhancement`exists in the mentioned link.
70
62
- Want to contribute code to this project?
71
-
- Best way to start is by picking up one of [the issues with `Up For Grab` label](https://github.com/mebjas/CSRF-Protector-PHP/issues?q=is%3Aissue+is%3Aopen+label%3A%22Up+For+Grabs%22). Leave a comment, that you intend to help on this > fork > send a pull request to `master branch`.
63
+
- The best way to start is by picking up one of the existing [issues with `Up For Grab` label](https://github.com/mebjas/CSRF-Protector-PHP/issues?q=is%3Aissue+is%3Aopen+label%3A%22Up+For+Grabs%22).
64
+
- Leave a comment, that you intend to help on this > then fork > and then send a pull request to `master branch`.
72
65
73
-
###FAQ:
66
+
## FAQ:
74
67
1. What happens if token expires? - https://github.com/mebjas/CSRF-Protector-PHP/wiki/what-if-token-expires
75
-
2. Secure flag in cookie? - https://github.com/mebjas/CSRF-Protector-PHP/issues/54
68
+
2. Secure flag in a cookie? - https://github.com/mebjas/CSRF-Protector-PHP/issues/54
This version (in `master` branch) requires the clients to have Javascript enabled. However if your application can work without javascript & you require a nojs version of this library, check our nojs version
0 commit comments