Skip to content

Commit

Permalink
1.7.1 version
Browse files Browse the repository at this point in the history
* origin/pr/77:
  Update version
  Add changelog for fix
  Fix vulnerability related to the one fixed in 2.6.5
  • Loading branch information
theboxer committed Jul 30, 2018
2 parents 52623dd + f67ddc4 commit 4e14230
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion _build/build.transport.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/* define package */
define('PKG_NAME','Gallery');
define('PKG_NAME_LOWER','gallery');
define('PKG_VERSION','1.7.0');
define('PKG_VERSION','1.7.1');
define('PKG_RELEASE','pl');

/* define sources */
Expand Down
2 changes: 1 addition & 1 deletion _build/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
,"lowCaseName": "gallery"
,"description": "Gallery"
,"author": "Shaun McCormick"
,"version": "1.7.0"
,"version": "1.7.1"
,"package":{
"actions": [{
"id": 1
Expand Down
Binary file not shown.
3 changes: 3 additions & 0 deletions core/components/gallery/docs/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Changelog for Gallery.

Gallery 1.7.1
====================================
- Fixed critical vulnerability in phpthumb processor
- Fixed namespace paths

Gallery 1.7.0
Expand Down
20 changes: 19 additions & 1 deletion core/components/gallery/processors/web/phpthumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,25 @@
$src = str_replace('+', '%27', urldecode($src));

/* explode tag options */
$ptOptions = $scriptProperties;
$ptOptions = array();

// Only public parameters of phpThumb should be allowed to pass from user input.
// List properties between START PARAMETERS and START PARAMETERS in src/core/model/phpthumb/phpthumb.class.php
$allowed = array(
'src', 'new', 'w', 'h', 'wp', 'hp', 'wl', 'hl', 'ws', 'hs',
'f', 'q', 'sx', 'sy', 'sw', 'sh', 'zc', 'bc', 'bg', 'fltr',
'goto', 'err', 'xto', 'ra', 'ar', 'aoe', 'far', 'iar', 'maxb', 'down',
'md5s', 'sfn', 'dpi', 'sia', 'phpThumbDebug'
);

/* iterate through properties */
foreach ($scriptProperties as $property => $value) {
if (!in_array($property, $allowed, true)) {
$this->modx->log(modX::LOG_LEVEL_WARN, "Detected attempt of using private parameter `$property` (for internal usage) of phpThumb that not allowed and insecure");
continue;
}
$ptOptions[$property] = $value;
}

if (empty($ptOptions['f'])) {
$ext = pathinfo($src, PATHINFO_EXTENSION);
Expand Down

0 comments on commit 4e14230

Please sign in to comment.