-
-
Notifications
You must be signed in to change notification settings - Fork 564
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
Add CSRF token #466
Add CSRF token #466
Conversation
settings.php
Outdated
@@ -863,6 +871,7 @@ function get_FTL_data($arg) | |||
<label for="zip_file">File input</label> | |||
<input type="file" name="zip_file" id="zip_file"> | |||
<p class="help-block">Upload only Pi-hole backup files.</p> | |||
<input type="hidden" name="token" value="<?php echo $token ?>"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sends the token only for Import
but not Export
(23 lines further up). Also note that this form's action is scripts/pi-hole/php/teleporter.php
which does not check the CSRF token at all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's under the same <form>
tag, so I think it does send the token. I added the CSRF check to teleporter and relocated the token just to be sure.
Approved |
By submitting this pull request, I confirm the following (please check boxes, eg [X] - no spaces) Failure to fill the template will close your PR:
Please submit all pull requests against the
development
branch. Failure to do so will delay or deny your requestHow familiar are you with the codebase?:
10
Fix #463 and #465 by adding a CSRF token requirement to settings page actions and securing the debug log.
This template was created based on the work of
udemy-dl
.