Changeset 3752945
- Timestamp:
- 10/18/2026 11:33:21 AM (30 hours ago)
- Location:
- webp-express
- Files:
-
- 20 edited
- 1 copied
-
tags/0.25.16 (copied) (copied from webp-express/trunk )
-
tags/0.25.16/README.txt (modified) (4 diffs)
-
tags/0.25.16/docs/publishing.md (modified) (2 diffs)
-
tags/0.25.16/lib/classes/ConvertHelperIndependent.php (modified) (1 diff)
-
tags/0.25.16/vendor/composer/installed.json (modified) (3 diffs)
-
tags/0.25.16/vendor/composer/installed.php (modified) (3 diffs)
-
tags/0.25.16/vendor/rosell-dk/dom-util-for-webp/README.md (modified) (1 diff)
-
tags/0.25.16/vendor/rosell-dk/dom-util-for-webp/src/ImageUrlReplacer.php (modified) (1 diff)
-
tags/0.25.16/vendor/rosell-dk/webp-convert-cloud-service/src/AccessCheck.php (modified) (2 diffs)
-
tags/0.25.16/vendor/rosell-dk/webp-convert-cloud-service/src/Serve.php (modified) (1 diff)
-
tags/0.25.16/webp-express.php (modified) (1 diff)
-
trunk/README.txt (modified) (4 diffs)
-
trunk/docs/publishing.md (modified) (2 diffs)
-
trunk/lib/classes/ConvertHelperIndependent.php (modified) (1 diff)
-
trunk/vendor/composer/installed.json (modified) (3 diffs)
-
trunk/vendor/composer/installed.php (modified) (3 diffs)
-
trunk/vendor/rosell-dk/dom-util-for-webp/README.md (modified) (1 diff)
-
trunk/vendor/rosell-dk/dom-util-for-webp/src/ImageUrlReplacer.php (modified) (1 diff)
-
trunk/vendor/rosell-dk/webp-convert-cloud-service/src/AccessCheck.php (modified) (2 diffs)
-
trunk/vendor/rosell-dk/webp-convert-cloud-service/src/Serve.php (modified) (1 diff)
-
trunk/webp-express.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
webp-express/tags/0.25.16/README.txt
r3578701 r3752945 5 5 Requires at least: 4.0 6 6 Tested up to: 6.9 7 Stable tag: 0.25.1 57 Stable tag: 0.25.16 8 8 Requires PHP: 5.6 9 9 License: GPLv3 … … 174 174 **Persons who recently contributed with [ko-fi](https://ko-fi.com/rosell) - Thanks!** 175 175 176 * 20 Sep: Greg 177 * 5 Aug: Abilio Varjao 178 * 23 Mar: hung minh dang 176 179 * 5 Jan: Joel 177 * 24 Dec: Patrick Müller 178 * 16 Dec: Dragos 179 * 9 Aug: Tanzi 180 * 3 Jul: Jen 181 * 26 Jun: Per 182 * 16 May: Erick Danzer 183 * 8 May: Mike 184 * 31 May: parallactic 185 * 14 May: Gitte Rebsdorf 186 * 9 May: La Braud 180 * 24 Dec 2025: Patrick Müller 187 181 188 182 **Persons who recently contributed on [github sponsors](https://github.com/sponsors/rosell-dk) - Thanks!** … … 832 826 == Changelog == 833 827 828 = 0.25.16 = 829 (released 18 Oct 2026) 830 * Fixed vulnerability in dom parser library used for altering html. Credit goes to Jakub Herman for discovering the problem. Also fixed a loophole that made it possible to use the web service (if activated) with carefully crafted inputs, even without an api key. Thanks to the third party that found and reported this to the Wordpress security team - and thanks to the security team for bringing the issue to my attention 831 834 832 = 0.25.15 = 835 833 (released 19 May 2026) … … 903 901 904 902 == Upgrade Notice == 903 = 0.25.16 = 904 * Fixed vulnerability in dom parser library used for altering html. Credit goes to Jakub Herman for discovering the problem. Also fixed a loophole that made it possible to use the web service (if activated) with carefully crafted inputs, even without an api key. Thanks to the third party that found and reported this to the Wordpress security team - and thanks to the security team for bringing the issue to my attention 905 905 906 906 = 0.25.15 = -
webp-express/tags/0.25.16/docs/publishing.md
r3578701 r3752945 97 97 - https://lutzenmanagement.dk/wp-admin/plugin-install.php 98 98 - http://mystress.dk/wp-admin/plugin-install.php 99 - fabeldyr.dk 99 100 ... etc 100 101 … … 113 114 ``` 114 115 cd svn 115 svn cp trunk tags/0.25.1 4(this will copy trunk into a new tag)116 svn cp trunk tags/0.25.15 (this will copy trunk into a new tag) 116 117 ``` 117 118 118 119 And commit! 119 120 ``` 120 svn ci -m '0.25.1 4'121 svn ci -m '0.25.15' 121 122 ``` 122 123 -
webp-express/tags/0.25.16/lib/classes/ConvertHelperIndependent.php
r3578701 r3752945 572 572 573 573 // TODO: Put version number somewhere else. Ie \WebPExpress\VersionNumber::version 574 $text = 'WebP Express 0.25.1 5. ' . $msgTop . ', ' . date("Y-m-d H:i:s") . "\n\r\n\r" . $text;574 $text = 'WebP Express 0.25.16. ' . $msgTop . ', ' . date("Y-m-d H:i:s") . "\n\r\n\r" . $text; 575 575 576 576 $logFile = self::getLogFilename($source, $logDir); -
webp-express/tags/0.25.16/vendor/composer/installed.json
r3578701 r3752945 210 210 { 211 211 "name": "rosell-dk/dom-util-for-webp", 212 "version": "0.7. 1",213 "version_normalized": "0.7. 1.0",212 "version": "0.7.2", 213 "version_normalized": "0.7.2.0", 214 214 "source": { 215 215 "type": "git", 216 216 "url": "https://github.com/rosell-dk/dom-util-for-webp.git", 217 "reference": " 4f9102e404ee137a781c8580b829a340c5a5d428"218 }, 219 "dist": { 220 "type": "zip", 221 "url": "https://api.github.com/repos/rosell-dk/dom-util-for-webp/zipball/ 4f9102e404ee137a781c8580b829a340c5a5d428",222 "reference": " 4f9102e404ee137a781c8580b829a340c5a5d428",217 "reference": "a69c667eb7a2449e402147586d3863d932f3f660" 218 }, 219 "dist": { 220 "type": "zip", 221 "url": "https://api.github.com/repos/rosell-dk/dom-util-for-webp/zipball/a69c667eb7a2449e402147586d3863d932f3f660", 222 "reference": "a69c667eb7a2449e402147586d3863d932f3f660", 223 223 "shasum": "" 224 224 }, … … 232 232 "squizlabs/php_codesniffer": "3.*" 233 233 }, 234 "time": "202 3-10-20T12:10:28+00:00",234 "time": "2026-10-18T08:43:30+00:00", 235 235 "type": "library", 236 236 "extra": { 237 237 "scripts-descriptions": { 238 238 "ci": "Run tests before CI", 239 "test": "Launches the preconfigured PHPUnit", 239 240 "phpcs": "Checks coding styles (PSR2) of file/dir, which you must supply. To check all, supply 'src'", 241 "cs-fix": "Fix the coding style of a PHP file or directory, which you must specify.", 240 242 "phpcbf": "Fix coding styles (PSR2) of file/dir, which you must supply. To fix all, supply 'src'", 241 "cs-fix-all": "Fix the coding style of all the source files, to comply with the PSR-2 coding standard", 242 "cs-fix": "Fix the coding style of a PHP file or directory, which you must specify.", 243 "test": "Launches the preconfigured PHPUnit" 243 "cs-fix-all": "Fix the coding style of all the source files, to comply with the PSR-2 coding standard" 244 244 } 245 245 }, … … 270 270 "support": { 271 271 "issues": "https://github.com/rosell-dk/dom-util-for-webp/issues", 272 "source": "https://github.com/rosell-dk/dom-util-for-webp/tree/0.7. 1"272 "source": "https://github.com/rosell-dk/dom-util-for-webp/tree/0.7.2" 273 273 }, 274 274 "funding": [ -
webp-express/tags/0.25.16/vendor/composer/installed.php
r3578701 r3752945 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' 9637ca4242e885f3d44b1382db5409fec8d5919d',6 'reference' => 'b5aba85e45f5c3a40987de3c96f1cbe43f8e99d5', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 30 30 ), 31 31 'rosell-dk/dom-util-for-webp' => array( 32 'pretty_version' => '0.7. 1',33 'version' => '0.7. 1.0',34 'reference' => ' 4f9102e404ee137a781c8580b829a340c5a5d428',32 'pretty_version' => '0.7.2', 33 'version' => '0.7.2.0', 34 'reference' => 'a69c667eb7a2449e402147586d3863d932f3f660', 35 35 'type' => 'library', 36 36 'install_path' => __DIR__ . '/../rosell-dk/dom-util-for-webp', … … 113 113 'pretty_version' => 'dev-master', 114 114 'version' => 'dev-master', 115 'reference' => ' 9637ca4242e885f3d44b1382db5409fec8d5919d',115 'reference' => 'b5aba85e45f5c3a40987de3c96f1cbe43f8e99d5', 116 116 'type' => 'wordpress-plugin', 117 117 'install_path' => __DIR__ . '/../../', -
webp-express/tags/0.25.16/vendor/rosell-dk/dom-util-for-webp/README.md
r2981697 r3752945 6 6 [](http://little-b.it/dom-util-for-webp/code-coverage/coverage/index.html) 7 7 [](https://github.com/rosell-dk/dom-util-for-webp/blob/master/LICENSE) 8 [](https://packagist.org/packages/rosell-dk/dom-util-for-webp/dependents?order_by=downloads) 8 9 9 10 *Replace image URLs found in HTML* -
webp-express/tags/0.25.16/vendor/rosell-dk/dom-util-for-webp/src/ImageUrlReplacer.php
r2981697 r3752945 180 180 } 181 181 182 // The parser (simple_html_dom) lifts content out of the HTML (script, style, code, comments, 183 // CDATA, PHP tags...) and leaves placeholders starting with "___noise___" in its place. It 184 // restores them later, in text and in attribute values, without escaping, and it keeps 185 // expanding until no marker is left. 186 // 187 // Input that contains the marker, or that ends in the start of it right before something the 188 // parser replaces with a placeholder (ie "___noise<![CDATA[x]]>"), breaks that assumption: 189 // - an attacker can make the parser restore a <code> body into an attribute value, which 190 // breaks out of the quotes (stored XSS via comments) 191 // - a marker that cannot be resolved makes restore_noise() loop forever (denial of service) 192 // 193 // Real pages never contain "___noise", so leave such HTML untouched rather than risk it. 194 // This check mitigates the vulnerability discovered by Jakub Herman 195 if (stripos($html, '___noise') !== false) { 196 return $html; 197 } 198 182 199 // https://stackoverflow.com/questions/4812691/preserve-line-breaks-simple-html-dom-parser 183 200 -
webp-express/tags/0.25.16/vendor/rosell-dk/webp-convert-cloud-service/src/AccessCheck.php
r1971426 r3752945 47 47 48 48 if (isset($_POST['salt']) && isset($_POST['api-key-crypted'])) { 49 if (CRYPT_BLOWFISH == 1) { 50 // Strip off the first 28 characters (the first 6 are always "$2y$10$". The next 22 is the salt) 51 $cryptedKey = substr(crypt($whitelistItem['api-key'], '$2y$10$' . $_POST['salt'] . '$'), 28); 52 if ($_POST['api-key-crypted'] == $cryptedKey) { 53 // Access granted! 54 return; 55 } 56 } else { 57 // trouble... 58 } 59 } else { 49 if (CRYPT_BLOWFISH == 1) { 50 $salt = $_POST['salt']; 51 $apiKeyCrypted = $_POST['api-key-crypted']; 52 53 // Step 1: salt must be exactly 22 bcrypt-alphabet characters 54 if (!is_string($salt) || !preg_match('/^[.\/0-9A-Za-z]{22}$/D', $salt)) { 55 continue; 56 } 57 58 // Step 2a: the submitted crypted key must be a non-empty string 59 if (!is_string($apiKeyCrypted) || $apiKeyCrypted === '') { 60 continue; 61 } 62 63 $fullHash = crypt($whitelistItem['api-key'], '$2y$10$' . $salt . '$'); 64 65 // Step 2b: crypt() must have returned a genuine bcrypt hash. 66 // (On failure it returns "*0" or "*1") 67 if (!is_string($fullHash) || strlen($fullHash) !== 60 || strpos($fullHash, '$2y$10$') !== 0) { 68 continue; 69 } 70 71 // Strip off the first 28 characters (7 for "$2y$10$", then the 22-char salt) 72 $cryptedKey = substr($fullHash, 28); 73 if (hash_equals($cryptedKey, $apiKeyCrypted)) { 74 // Access granted! 75 return; 76 } 77 } else { 78 // crypt_blowfish not available, access cannot be granted 79 // we fail silently 80 } 81 } else { 60 82 $hashingRequired = ( 61 83 isset($whitelistItem['require-api-key-to-be-crypted-in-transfer']) && … … 63 85 ); 64 86 if (!$hashingRequired && isset($_POST['api-key'])) { 65 if ($_POST['api-key'] == $whitelistItem['api-key']) { 66 // Access granted! 67 return; 68 } 69 } 87 if ( 88 is_string($_POST['api-key']) && 89 is_string($whitelistItem['api-key']) && 90 hash_equals($whitelistItem['api-key'], $_POST['api-key']) 91 ) { 92 // Access granted! 93 return; 94 } 95 } 70 96 } 71 97 } -
webp-express/tags/0.25.16/vendor/rosell-dk/webp-convert-cloud-service/src/Serve.php
r2114927 r3752945 120 120 121 121 try { 122 WebPConvert::convert($source, $destination, $convertOptions); 123 header('Content-type: application/octet-stream'); 124 echo file_get_contents($destination); 122 WebPConvert::convert($source, $destination, $convertOptions); 123 header('Content-type: application/octet-stream'); 124 echo file_get_contents($destination); 125 } catch (\Exception $e) { 126 echo 'Conversion failed!'; 127 //echo $e->getMessage(); // disabled, in order to be sure we dont leak server paths. TODO: provide a safe alternative 128 } finally { 129 // Always remove the uploaded file and any partial output, 130 // whether conversion succeeded, failed, or threw something 131 // other than \Exception (e.g. a \Throwable/\Error on PHP 7+). 132 if (file_exists($source)) { 133 @unlink($source); 134 } 135 if (file_exists($destination)) { 136 @unlink($destination); 137 } 138 } 125 139 126 unlink($source);127 unlink($destination);128 } catch (\Exception $e) {129 echo 'Conversion failed!';130 echo $e->getMessage();131 }132 140 } else { 133 141 // Possible file upload attack! -
webp-express/tags/0.25.16/webp-express.php
r3578701 r3752945 4 4 * Plugin URI: https://github.com/rosell-dk/webp-express 5 5 * Description: Serve autogenerated WebP images instead of jpeg/png to browsers that supports WebP. Works on anything (media library images, galleries, theme images etc). 6 * Version: 0.25.1 56 * Version: 0.25.16 7 7 * Author: Bjørn Rosell 8 8 * Author URI: https://www.bitwise-it.dk -
webp-express/trunk/README.txt
r3578701 r3752945 5 5 Requires at least: 4.0 6 6 Tested up to: 6.9 7 Stable tag: 0.25.1 57 Stable tag: 0.25.16 8 8 Requires PHP: 5.6 9 9 License: GPLv3 … … 174 174 **Persons who recently contributed with [ko-fi](https://ko-fi.com/rosell) - Thanks!** 175 175 176 * 20 Sep: Greg 177 * 5 Aug: Abilio Varjao 178 * 23 Mar: hung minh dang 176 179 * 5 Jan: Joel 177 * 24 Dec: Patrick Müller 178 * 16 Dec: Dragos 179 * 9 Aug: Tanzi 180 * 3 Jul: Jen 181 * 26 Jun: Per 182 * 16 May: Erick Danzer 183 * 8 May: Mike 184 * 31 May: parallactic 185 * 14 May: Gitte Rebsdorf 186 * 9 May: La Braud 180 * 24 Dec 2025: Patrick Müller 187 181 188 182 **Persons who recently contributed on [github sponsors](https://github.com/sponsors/rosell-dk) - Thanks!** … … 832 826 == Changelog == 833 827 828 = 0.25.16 = 829 (released 18 Oct 2026) 830 * Fixed vulnerability in dom parser library used for altering html. Credit goes to Jakub Herman for discovering the problem. Also fixed a loophole that made it possible to use the web service (if activated) with carefully crafted inputs, even without an api key. Thanks to the third party that found and reported this to the Wordpress security team - and thanks to the security team for bringing the issue to my attention 831 834 832 = 0.25.15 = 835 833 (released 19 May 2026) … … 903 901 904 902 == Upgrade Notice == 903 = 0.25.16 = 904 * Fixed vulnerability in dom parser library used for altering html. Credit goes to Jakub Herman for discovering the problem. Also fixed a loophole that made it possible to use the web service (if activated) with carefully crafted inputs, even without an api key. Thanks to the third party that found and reported this to the Wordpress security team - and thanks to the security team for bringing the issue to my attention 905 905 906 906 = 0.25.15 = -
webp-express/trunk/docs/publishing.md
r3578701 r3752945 97 97 - https://lutzenmanagement.dk/wp-admin/plugin-install.php 98 98 - http://mystress.dk/wp-admin/plugin-install.php 99 - fabeldyr.dk 99 100 ... etc 100 101 … … 113 114 ``` 114 115 cd svn 115 svn cp trunk tags/0.25.1 4(this will copy trunk into a new tag)116 svn cp trunk tags/0.25.15 (this will copy trunk into a new tag) 116 117 ``` 117 118 118 119 And commit! 119 120 ``` 120 svn ci -m '0.25.1 4'121 svn ci -m '0.25.15' 121 122 ``` 122 123 -
webp-express/trunk/lib/classes/ConvertHelperIndependent.php
r3578701 r3752945 572 572 573 573 // TODO: Put version number somewhere else. Ie \WebPExpress\VersionNumber::version 574 $text = 'WebP Express 0.25.1 5. ' . $msgTop . ', ' . date("Y-m-d H:i:s") . "\n\r\n\r" . $text;574 $text = 'WebP Express 0.25.16. ' . $msgTop . ', ' . date("Y-m-d H:i:s") . "\n\r\n\r" . $text; 575 575 576 576 $logFile = self::getLogFilename($source, $logDir); -
webp-express/trunk/vendor/composer/installed.json
r3578701 r3752945 210 210 { 211 211 "name": "rosell-dk/dom-util-for-webp", 212 "version": "0.7. 1",213 "version_normalized": "0.7. 1.0",212 "version": "0.7.2", 213 "version_normalized": "0.7.2.0", 214 214 "source": { 215 215 "type": "git", 216 216 "url": "https://github.com/rosell-dk/dom-util-for-webp.git", 217 "reference": " 4f9102e404ee137a781c8580b829a340c5a5d428"218 }, 219 "dist": { 220 "type": "zip", 221 "url": "https://api.github.com/repos/rosell-dk/dom-util-for-webp/zipball/ 4f9102e404ee137a781c8580b829a340c5a5d428",222 "reference": " 4f9102e404ee137a781c8580b829a340c5a5d428",217 "reference": "a69c667eb7a2449e402147586d3863d932f3f660" 218 }, 219 "dist": { 220 "type": "zip", 221 "url": "https://api.github.com/repos/rosell-dk/dom-util-for-webp/zipball/a69c667eb7a2449e402147586d3863d932f3f660", 222 "reference": "a69c667eb7a2449e402147586d3863d932f3f660", 223 223 "shasum": "" 224 224 }, … … 232 232 "squizlabs/php_codesniffer": "3.*" 233 233 }, 234 "time": "202 3-10-20T12:10:28+00:00",234 "time": "2026-10-18T08:43:30+00:00", 235 235 "type": "library", 236 236 "extra": { 237 237 "scripts-descriptions": { 238 238 "ci": "Run tests before CI", 239 "test": "Launches the preconfigured PHPUnit", 239 240 "phpcs": "Checks coding styles (PSR2) of file/dir, which you must supply. To check all, supply 'src'", 241 "cs-fix": "Fix the coding style of a PHP file or directory, which you must specify.", 240 242 "phpcbf": "Fix coding styles (PSR2) of file/dir, which you must supply. To fix all, supply 'src'", 241 "cs-fix-all": "Fix the coding style of all the source files, to comply with the PSR-2 coding standard", 242 "cs-fix": "Fix the coding style of a PHP file or directory, which you must specify.", 243 "test": "Launches the preconfigured PHPUnit" 243 "cs-fix-all": "Fix the coding style of all the source files, to comply with the PSR-2 coding standard" 244 244 } 245 245 }, … … 270 270 "support": { 271 271 "issues": "https://github.com/rosell-dk/dom-util-for-webp/issues", 272 "source": "https://github.com/rosell-dk/dom-util-for-webp/tree/0.7. 1"272 "source": "https://github.com/rosell-dk/dom-util-for-webp/tree/0.7.2" 273 273 }, 274 274 "funding": [ -
webp-express/trunk/vendor/composer/installed.php
r3578701 r3752945 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' 9637ca4242e885f3d44b1382db5409fec8d5919d',6 'reference' => 'b5aba85e45f5c3a40987de3c96f1cbe43f8e99d5', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 30 30 ), 31 31 'rosell-dk/dom-util-for-webp' => array( 32 'pretty_version' => '0.7. 1',33 'version' => '0.7. 1.0',34 'reference' => ' 4f9102e404ee137a781c8580b829a340c5a5d428',32 'pretty_version' => '0.7.2', 33 'version' => '0.7.2.0', 34 'reference' => 'a69c667eb7a2449e402147586d3863d932f3f660', 35 35 'type' => 'library', 36 36 'install_path' => __DIR__ . '/../rosell-dk/dom-util-for-webp', … … 113 113 'pretty_version' => 'dev-master', 114 114 'version' => 'dev-master', 115 'reference' => ' 9637ca4242e885f3d44b1382db5409fec8d5919d',115 'reference' => 'b5aba85e45f5c3a40987de3c96f1cbe43f8e99d5', 116 116 'type' => 'wordpress-plugin', 117 117 'install_path' => __DIR__ . '/../../', -
webp-express/trunk/vendor/rosell-dk/dom-util-for-webp/README.md
r2981697 r3752945 6 6 [](http://little-b.it/dom-util-for-webp/code-coverage/coverage/index.html) 7 7 [](https://github.com/rosell-dk/dom-util-for-webp/blob/master/LICENSE) 8 [](https://packagist.org/packages/rosell-dk/dom-util-for-webp/dependents?order_by=downloads) 8 9 9 10 *Replace image URLs found in HTML* -
webp-express/trunk/vendor/rosell-dk/dom-util-for-webp/src/ImageUrlReplacer.php
r2981697 r3752945 180 180 } 181 181 182 // The parser (simple_html_dom) lifts content out of the HTML (script, style, code, comments, 183 // CDATA, PHP tags...) and leaves placeholders starting with "___noise___" in its place. It 184 // restores them later, in text and in attribute values, without escaping, and it keeps 185 // expanding until no marker is left. 186 // 187 // Input that contains the marker, or that ends in the start of it right before something the 188 // parser replaces with a placeholder (ie "___noise<![CDATA[x]]>"), breaks that assumption: 189 // - an attacker can make the parser restore a <code> body into an attribute value, which 190 // breaks out of the quotes (stored XSS via comments) 191 // - a marker that cannot be resolved makes restore_noise() loop forever (denial of service) 192 // 193 // Real pages never contain "___noise", so leave such HTML untouched rather than risk it. 194 // This check mitigates the vulnerability discovered by Jakub Herman 195 if (stripos($html, '___noise') !== false) { 196 return $html; 197 } 198 182 199 // https://stackoverflow.com/questions/4812691/preserve-line-breaks-simple-html-dom-parser 183 200 -
webp-express/trunk/vendor/rosell-dk/webp-convert-cloud-service/src/AccessCheck.php
r1971426 r3752945 47 47 48 48 if (isset($_POST['salt']) && isset($_POST['api-key-crypted'])) { 49 if (CRYPT_BLOWFISH == 1) { 50 // Strip off the first 28 characters (the first 6 are always "$2y$10$". The next 22 is the salt) 51 $cryptedKey = substr(crypt($whitelistItem['api-key'], '$2y$10$' . $_POST['salt'] . '$'), 28); 52 if ($_POST['api-key-crypted'] == $cryptedKey) { 53 // Access granted! 54 return; 55 } 56 } else { 57 // trouble... 58 } 59 } else { 49 if (CRYPT_BLOWFISH == 1) { 50 $salt = $_POST['salt']; 51 $apiKeyCrypted = $_POST['api-key-crypted']; 52 53 // Step 1: salt must be exactly 22 bcrypt-alphabet characters 54 if (!is_string($salt) || !preg_match('/^[.\/0-9A-Za-z]{22}$/D', $salt)) { 55 continue; 56 } 57 58 // Step 2a: the submitted crypted key must be a non-empty string 59 if (!is_string($apiKeyCrypted) || $apiKeyCrypted === '') { 60 continue; 61 } 62 63 $fullHash = crypt($whitelistItem['api-key'], '$2y$10$' . $salt . '$'); 64 65 // Step 2b: crypt() must have returned a genuine bcrypt hash. 66 // (On failure it returns "*0" or "*1") 67 if (!is_string($fullHash) || strlen($fullHash) !== 60 || strpos($fullHash, '$2y$10$') !== 0) { 68 continue; 69 } 70 71 // Strip off the first 28 characters (7 for "$2y$10$", then the 22-char salt) 72 $cryptedKey = substr($fullHash, 28); 73 if (hash_equals($cryptedKey, $apiKeyCrypted)) { 74 // Access granted! 75 return; 76 } 77 } else { 78 // crypt_blowfish not available, access cannot be granted 79 // we fail silently 80 } 81 } else { 60 82 $hashingRequired = ( 61 83 isset($whitelistItem['require-api-key-to-be-crypted-in-transfer']) && … … 63 85 ); 64 86 if (!$hashingRequired && isset($_POST['api-key'])) { 65 if ($_POST['api-key'] == $whitelistItem['api-key']) { 66 // Access granted! 67 return; 68 } 69 } 87 if ( 88 is_string($_POST['api-key']) && 89 is_string($whitelistItem['api-key']) && 90 hash_equals($whitelistItem['api-key'], $_POST['api-key']) 91 ) { 92 // Access granted! 93 return; 94 } 95 } 70 96 } 71 97 } -
webp-express/trunk/vendor/rosell-dk/webp-convert-cloud-service/src/Serve.php
r2114927 r3752945 120 120 121 121 try { 122 WebPConvert::convert($source, $destination, $convertOptions); 123 header('Content-type: application/octet-stream'); 124 echo file_get_contents($destination); 122 WebPConvert::convert($source, $destination, $convertOptions); 123 header('Content-type: application/octet-stream'); 124 echo file_get_contents($destination); 125 } catch (\Exception $e) { 126 echo 'Conversion failed!'; 127 //echo $e->getMessage(); // disabled, in order to be sure we dont leak server paths. TODO: provide a safe alternative 128 } finally { 129 // Always remove the uploaded file and any partial output, 130 // whether conversion succeeded, failed, or threw something 131 // other than \Exception (e.g. a \Throwable/\Error on PHP 7+). 132 if (file_exists($source)) { 133 @unlink($source); 134 } 135 if (file_exists($destination)) { 136 @unlink($destination); 137 } 138 } 125 139 126 unlink($source);127 unlink($destination);128 } catch (\Exception $e) {129 echo 'Conversion failed!';130 echo $e->getMessage();131 }132 140 } else { 133 141 // Possible file upload attack! -
webp-express/trunk/webp-express.php
r3578701 r3752945 4 4 * Plugin URI: https://github.com/rosell-dk/webp-express 5 5 * Description: Serve autogenerated WebP images instead of jpeg/png to browsers that supports WebP. Works on anything (media library images, galleries, theme images etc). 6 * Version: 0.25.1 56 * Version: 0.25.16 7 7 * Author: Bjørn Rosell 8 8 * Author URI: https://www.bitwise-it.dk
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)