Skip to content

Commit

Permalink
Fix for user reported CVE path-based open redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Mar 18, 2020
1 parent 6f2be2a commit 2eae104
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Moved `Parsedown` 1.6 and `ParsedownExtra` 0.7 into `Grav\Framework\Parsedown` to allow fixes
1. [](#bugfix)
* Fixed PHP 7.4 issue in ParsedownExtra [#2832](https://github.com/getgrav/grav/issues/2832)
* Fix for [user reported](https://twitter.com/OriginalSicksec) CVE path-based open redirect

# v1.6.22
## 03/05/2020
Expand Down
5 changes: 4 additions & 1 deletion system/src/Grav/Common/Grav.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,10 @@ public function redirect($route, $code = null)
/** @var Uri $uri */
$uri = $this['uri'];

//Check for code in route
// Clean route for redirect
$route = preg_replace("#^\/[\\\/]+\/#", '/', $route);

// Check for code in route
$regex = '/.*(\[(30[1-7])\])$/';
preg_match($regex, $route, $matches);
if ($matches) {
Expand Down

3 comments on commit 2eae104

@Sicks3c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Hello @rhukster

I would like to report a bypass to this that I have found
I'm the same person that reports the actual open redirect via email which was assigned to CVE

Looks like this payload can reproduce the open redirect again
Open Redirect

POC

getgrav

@rhukster
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fixed in Grav 1.7RC, but not yet in Grav 1.6 (which getgrav.org runs).

@Sicks3c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any Grav 1.7 Website where I can test on it ?

Please sign in to comment.