1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-22 04:23:01 +00:00

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] 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] 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] 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 ## v0.23

View file

@ -47,11 +47,10 @@ if(!isset($pageindex->{$env->page}) and isset($_GET["search-redirect"]))
// Perform the appropriate action // Perform the appropriate action
$action_name = $env->action; if(isset($actions->{$env->action})) {
if(isset($actions->$action_name)) { $req_action_data = $actions->{$env->action};
$req_action_data = $actions->$action_name;
$req_action_data(); $req_action_data();
} }
else { 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>"));
} }