Skip to content
Permalink
Browse files
100-run: fix XSS when action is not found
  • Loading branch information
sbrl committed Sep 25, 2021
1 parent 978da55 commit 2e1e1d05352c014501b8ee361950d398c2f38b96
Showing with 4 additions and 4 deletions.
  1. +1 −0 Changelog.md
  2. +3 −4 core/100-run.php
@@ -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
@@ -47,11 +47,10 @@


// 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>"));
}

0 comments on commit 2e1e1d0

Please sign in to comment.