Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
100-run: fix XSS when action is not found
  • Loading branch information
sbrl committed Sep 25, 2021
1 parent 978da55 commit 2e1e1d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions core/100-run.php
Expand Up @@ -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.