Skip to content

Commit ef0581d

Browse files
committed
Fix security issue allowing a user to view any file on the system
Fixes #2
1 parent 0085027 commit ef0581d

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## 3.0.1 - 2019-06-03
2+
### Fixed
3+
- Fix security issue allowing a user to view any file on the system #2
4+
5+
## 3.0.0 - 2017-12-01
6+
Initial Release

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ether/logs",
33
"description": "Access logs from the CP",
4-
"version": "3.0.0",
4+
"version": "3.0.1",
55
"type": "craft-plugin",
66
"minimum-stability": "dev",
77
"require": {

src/Utility.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ function ($var) {
4141
if (!count($logFiles))
4242
return '<p>You don\'t have any log files.</p>';
4343

44-
$currentLog = Craft::$app->request->get('log', $logFiles[0]);
44+
$currentLog = basename(Craft::$app->request->get('log', $logFiles[0]));
45+
46+
if (strpos($currentLog, '.log') === false)
47+
return '<p>You can only access <code>.log</code> files!</p>';
4548

4649
$url = explode('?log', Craft::$app->request->url)[0];
4750

0 commit comments

Comments
 (0)