Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/bunnycdn/bunnycdn.php
+++ b/bunnycdn/bunnycdn.php
@@ -27,7 +27,7 @@
Plugin Name: bunny.net
Plugin URI: https://bunny.net/
Description: Speed up your website with bunny.net Content Delivery Network. This plugin allows you to easily enable Bunny CDN on your WordPress website and enjoy greatly improved loading times around the world.
-Version: 2.3.6
+Version: 2.3.7
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 8.1
@@ -37,7 +37,7 @@
Text Domain: bunnycdn
*/
-const BUNNYCDN_WP_VERSION = '2.3.6';
+const BUNNYCDN_WP_VERSION = '2.3.7';
require_once __DIR__.'/src/functions.php';
--- a/bunnycdn/src/Admin/Controller/Offloader.php
+++ b/bunnycdn/src/Admin/Controller/Offloader.php
@@ -50,6 +50,7 @@
return;
}
if ($isAjax && isset($_POST['perform']) && 'resolve-conflict' === $_POST['perform']) {
+ check_admin_referer('bunnycdn-save-offloader');
$id = (int) sanitize_key($_POST['attachment_id'] ?? 0);
$keep = sanitize_key($_POST['keep'] ?? '');
try {
--- a/bunnycdn/src/Admin/Router.php
+++ b/bunnycdn/src/Admin/Router.php
@@ -35,6 +35,11 @@
public function route(bool $isAjax = false): void
{
+ if (!current_user_can('manage_options')) {
+ $this->render401($isAjax);
+
+ return;
+ }
$section = 'index';
if (isset($_REQUEST['section'])) {
$section = sanitize_key($_REQUEST['section']);
@@ -52,4 +57,15 @@
}
$this->container->renderTemplateFile('index.error.php', ['error' => __('Page not found', 'bunnycdn')], ['cssClass' => 'index'], '_base.index.php');
}
+
+ private function render401(bool $isAjax): void
+ {
+ header('HTTP/1.1 401 Unauthorized');
+ if ($isAjax) {
+ wp_send_json_error(['message' => __('Unauthorized', 'bunnycdn')], 401);
+ } else {
+ $this->container->renderTemplateFile('index.error.php', ['error' => __('Unauthorized', 'bunnycdn')], ['cssClass' => 'index'], '_base.index.php');
+ }
+ wp_die();
+ }
}
--- a/bunnycdn/vendor/composer/installed.php
+++ b/bunnycdn/vendor/composer/installed.php
@@ -1,5 +1,5 @@
<?php
namespace {
- return array('root' => array('name' => '__root__', 'pretty_version' => '2.3.6', 'version' => '2.3.6.0', 'reference' => 'cb1bd5694a755a37a15bd6a069b750e198db5aa6', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => false), 'versions' => array('__root__' => array('pretty_version' => '2.3.6', 'version' => '2.3.6.0', 'reference' => 'cb1bd5694a755a37a15bd6a069b750e198db5aa6', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false), 'bunnycdn/storage' => array('pretty_version' => '3.4.0', 'version' => '3.4.0.0', 'reference' => 'a7709849f6779b85d2871a43a12fcd452b970c25', 'type' => 'library', 'install_path' => __DIR__ . '/../bunnycdn/storage', 'aliases' => array(), 'dev_requirement' => false), 'guzzlehttp/guzzle' => array('pretty_version' => '7.10.0', 'version' => '7.10.0.0', 'reference' => 'b51ac707cfa420b7bfd4e4d5e510ba8008e822b4', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', 'aliases' => array(), 'dev_requirement' => false), 'guzzlehttp/promises' => array('pretty_version' => '2.3.0', 'version' => '2.3.0.0', 'reference' => '481557b130ef3790cf82b713667b43030dc9c957', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/promises', 'aliases' => array(), 'dev_requirement' => false), 'guzzlehttp/psr7' => array('pretty_version' => '2.8.0', 'version' => '2.8.0.0', 'reference' => '21dc724a0583619cd1652f673303492272778051', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'aliases' => array(), 'dev_requirement' => false), 'psr/http-client' => array('pretty_version' => '1.0.3', 'version' => '1.0.3.0', 'reference' => 'bb5906edc1c324c9a05aa0873d40117941e5fa90', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-client', 'aliases' => array(), 'dev_requirement' => false), 'psr/http-client-implementation' => array('dev_requirement' => false, 'provided' => array(0 => '1.0')), 'psr/http-factory' => array('pretty_version' => '1.1.0', 'version' => '1.1.0.0', 'reference' => '2b4765fddfe3b508ac62f829e852b1501d3f6e8a', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-factory', 'aliases' => array(), 'dev_requirement' => false), 'psr/http-factory-implementation' => array('dev_requirement' => false, 'provided' => array(0 => '1.0')), 'psr/http-message' => array('pretty_version' => '2.0', 'version' => '2.0.0.0', 'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-message', 'aliases' => array(), 'dev_requirement' => false), 'psr/http-message-implementation' => array('dev_requirement' => false, 'provided' => array(0 => '1.0')), 'ralouphie/getallheaders' => array('pretty_version' => '3.0.3', 'version' => '3.0.3.0', 'reference' => '120b605dfeb996808c31b6477290a714d356e822', 'type' => 'library', 'install_path' => __DIR__ . '/../ralouphie/getallheaders', 'aliases' => array(), 'dev_requirement' => false), 'symfony/deprecation-contracts' => array('pretty_version' => 'v3.6.0', 'version' => '3.6.0.0', 'reference' => '63afe740e99a13ba87ec199bb07bbdee937a5b62', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), 'dev_requirement' => false), 'symfony/polyfill-php80' => array('pretty_version' => 'v1.33.0', 'version' => '1.33.0.0', 'reference' => '0cc9dd0f17f61d8131e7df6b84bd344899fe2608', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 'aliases' => array(), 'dev_requirement' => false)));
+ return array('root' => array('name' => '__root__', 'pretty_version' => '2.3.7', 'version' => '2.3.7.0', 'reference' => '72f14461dbe6e657b5c053e01d9369cb54a5810a', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => false), 'versions' => array('__root__' => array('pretty_version' => '2.3.7', 'version' => '2.3.7.0', 'reference' => '72f14461dbe6e657b5c053e01d9369cb54a5810a', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false), 'bunnycdn/storage' => array('pretty_version' => '3.4.0', 'version' => '3.4.0.0', 'reference' => 'a7709849f6779b85d2871a43a12fcd452b970c25', 'type' => 'library', 'install_path' => __DIR__ . '/../bunnycdn/storage', 'aliases' => array(), 'dev_requirement' => false), 'guzzlehttp/guzzle' => array('pretty_version' => '7.10.0', 'version' => '7.10.0.0', 'reference' => 'b51ac707cfa420b7bfd4e4d5e510ba8008e822b4', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', 'aliases' => array(), 'dev_requirement' => false), 'guzzlehttp/promises' => array('pretty_version' => '2.3.0', 'version' => '2.3.0.0', 'reference' => '481557b130ef3790cf82b713667b43030dc9c957', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/promises', 'aliases' => array(), 'dev_requirement' => false), 'guzzlehttp/psr7' => array('pretty_version' => '2.8.0', 'version' => '2.8.0.0', 'reference' => '21dc724a0583619cd1652f673303492272778051', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'aliases' => array(), 'dev_requirement' => false), 'psr/http-client' => array('pretty_version' => '1.0.3', 'version' => '1.0.3.0', 'reference' => 'bb5906edc1c324c9a05aa0873d40117941e5fa90', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-client', 'aliases' => array(), 'dev_requirement' => false), 'psr/http-client-implementation' => array('dev_requirement' => false, 'provided' => array(0 => '1.0')), 'psr/http-factory' => array('pretty_version' => '1.1.0', 'version' => '1.1.0.0', 'reference' => '2b4765fddfe3b508ac62f829e852b1501d3f6e8a', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-factory', 'aliases' => array(), 'dev_requirement' => false), 'psr/http-factory-implementation' => array('dev_requirement' => false, 'provided' => array(0 => '1.0')), 'psr/http-message' => array('pretty_version' => '2.0', 'version' => '2.0.0.0', 'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-message', 'aliases' => array(), 'dev_requirement' => false), 'psr/http-message-implementation' => array('dev_requirement' => false, 'provided' => array(0 => '1.0')), 'ralouphie/getallheaders' => array('pretty_version' => '3.0.3', 'version' => '3.0.3.0', 'reference' => '120b605dfeb996808c31b6477290a714d356e822', 'type' => 'library', 'install_path' => __DIR__ . '/../ralouphie/getallheaders', 'aliases' => array(), 'dev_requirement' => false), 'symfony/deprecation-contracts' => array('pretty_version' => 'v3.6.0', 'version' => '3.6.0.0', 'reference' => '63afe740e99a13ba87ec199bb07bbdee937a5b62', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), 'dev_requirement' => false), 'symfony/polyfill-php80' => array('pretty_version' => 'v1.33.0', 'version' => '1.33.0.0', 'reference' => '0cc9dd0f17f61d8131e7df6b84bd344899fe2608', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 'aliases' => array(), 'dev_requirement' => false)));
}