Skip to content

Commit

Permalink
Bugfix: XSS in format GET param of stats action
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrl committed Sep 21, 2021
1 parent bca1548 commit 4be6a18
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Changelog.md
Expand Up @@ -4,7 +4,8 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t

## v0.24-dev

(none yet! More improvements coming soon :D)
### Fixed
- [security] Fixed an XSS vulnerability in the `format` GET parameter of the `stats` action (thanks, @JamieSlome)


## v0.23
Expand Down
2 changes: 1 addition & 1 deletion modules/feature-stats.php
Expand Up @@ -33,7 +33,7 @@
global $settings, $statistic_calculators;

$allowed_formats = [ "html", "json" ];
$format = $_GET["format"] ?? "html";
$format = slugify($_GET["format"]) ?? "html";

if(!in_array($format, $allowed_formats)) {
http_response_code(400);
Expand Down

0 comments on commit 4be6a18

Please sign in to comment.