100-run: fix XSS when action is not found

This commit is contained in:
Starbeamrainbowlabs 2021-09-25 11:42:07 +01:00
parent 978da55e00
commit 2e1e1d0535
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
2 changed files with 4 additions and 4 deletions

View File

@ -8,6 +8,7 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
- [security] Fixed an XSS vulnerability in the `format` GET parameter of the `stats` action (thanks, @JamieSlome)
- [security] Ensured that the `returnto` GET parameter leads you only to another place on your Pepperminty Wiki instance (thanks, @JamieSlome)
- [security] Ensure that Javascript in SVGs never gets executed (it's too challenging to strip it, since it could be lurking in many different places - according to [this answer](https://stackoverflow.com/a/68505306/1460422) even Inkscape doesn't strip all Javascript when asked to)
- [security] Fixed XSS when the `action` GET param doesn't match a known action
## v0.23

View File

@ -47,11 +47,10 @@ if(!isset($pageindex->{$env->page}) and isset($_GET["search-redirect"]))
// Perform the appropriate action
$action_name = $env->action;
if(isset($actions->$action_name)) {
$req_action_data = $actions->$action_name;
if(isset($actions->{$env->action})) {
$req_action_data = $actions->{$env->action};
$req_action_data();
}
else {
exit(page_renderer::render_main("Error - $settings->sitename", "<p>No action called " . strtolower($_GET["action"]) ." has been registered. Perhaps you are missing a module?</p>"));
exit(page_renderer::render_main("Error - $settings->sitename", "<p>No action called $env->action has been registered. Perhaps you are missing a module?</p>"));
}