From 55ca7b96b42510dcef58f00e711203fa000e3677 Mon Sep 17 00:00:00 2001 From: "Daniel L. Iser" Date: Thu, 13 Aug 2026 18:33:20 -0400 Subject: [PATCH 1/6] Fix authorization for settings REST endpoint --- CHANGELOG.md | 2 ++ classes/RestAPI/Settings.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 219f69c2..eee30196 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- Security: Restricted REST API access to global plugin settings to authorized administrators. + ## v2.6.5 - 05/27/2025 - Developer: Passed the original filtered content to the restricted message filter. diff --git a/classes/RestAPI/Settings.php b/classes/RestAPI/Settings.php index 9bc63d67..4d650ff3 100644 --- a/classes/RestAPI/Settings.php +++ b/classes/RestAPI/Settings.php @@ -46,7 +46,7 @@ public function register_routes() { [ 'methods' => WP_REST_Server::READABLE, 'callback' => [ $this, 'get_settings' ], - 'permission_callback' => '__return_true', // Read only, so anyone can view. + 'permission_callback' => [ $this, 'update_settings_permissions' ], ], [ 'methods' => WP_REST_Server::EDITABLE, @@ -101,7 +101,7 @@ public function update_settings( $request ) { } /** - * Check update settings permissions. + * Check settings permissions. * * @return WP_Error|bool */ From 135341b46e2e2aaadf99f6fc30e9b2334b172b05 Mon Sep 17 00:00:00 2001 From: "Daniel L. Iser" Date: Thu, 13 Aug 2026 18:40:04 -0400 Subject: [PATCH 2/6] Prepare 2.6.6 security hotfix --- CHANGELOG.md | 2 ++ content-control.php | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- readme.txt | 6 +++++- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eee30196..42d7234b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## v2.6.6 - 08/13/2026 + - Security: Restricted REST API access to global plugin settings to authorized administrators. ## v2.6.5 - 05/27/2025 diff --git a/content-control.php b/content-control.php index 58451193..a875830e 100644 --- a/content-control.php +++ b/content-control.php @@ -3,7 +3,7 @@ * Plugin Name: Content Control * Plugin URI: https://contentcontrolplugin.com/?utm_campaign=plugin-info&utm_source=php-file-header&utm_medium=plugin-ui&utm_content=plugin-uri * Description: Restrict content to logged in/out users or specific user roles. Restrict access to certain parts of a page/post. Control the visibility of widgets. - * Version: 2.6.5 + * Version: 2.6.6 * Author: Code Atlantic * Author URI: https://code-atlantic.com/?utm_campaign=plugin-info&utm_source=php-file-header&utm_medium=plugin-ui&utm_content=author-uri * Donate link: https://code-atlantic.com/donate/?utm_campaign=donations&utm_source=php-file-header&utm_medium=plugin-ui&utm_content=donate-link @@ -30,7 +30,7 @@ function get_plugin_config() { return [ 'name' => 'Content Control', 'slug' => 'content-control', - 'version' => '2.6.5', + 'version' => '2.6.6', 'option_prefix' => 'content_control', // Maybe remove this and simply prefix `name` with `'Popup Maker'`. 'text_domain' => 'content-control', diff --git a/package-lock.json b/package-lock.json index 4cf68916..2d6870e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "content-control", - "version": "2.6.1", + "version": "2.6.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "content-control", - "version": "2.6.1", + "version": "2.6.6", "license": "GPL-2.0-or-later", "workspaces": [ "./packages/*" diff --git a/package.json b/package.json index 516aa55f..2941c3ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "content-control", - "version": "2.6.5", + "version": "2.6.6", "description": "", "author": "Code Atlantic LLC", "license": "GPL-2.0-or-later", diff --git a/readme.txt b/readme.txt index e7f7cecc..0dece05a 100644 --- a/readme.txt +++ b/readme.txt @@ -6,7 +6,7 @@ Donate link: https://code-atlantic.com/donate/?utm_campaign=donations&utm_source Tags: membership, access control, members only, content restriction, maintenance mode Requires at least: 6.2 Tested up to: 7.0.0 -Stable tag: 2.6.5 +Stable tag: 2.6.6 Requires PHP: 7.4 License: GPLv3 (or later) @@ -110,6 +110,10 @@ Bugs can be reported either in our support forum or we are happy to accept PRs o == Changelog == += v2.6.6 - 08/13/2026 = + +* Security: Restricted REST API access to global plugin settings to authorized administrators. + = v2.6.5 - 05/27/2025 = * Tweak: Passed the original filtered content to the restricted message filter. From eec31f6d53daf5039874e3863f4a39e8cfaf3531 Mon Sep 17 00:00:00 2001 From: "Daniel L. Iser" Date: Thu, 13 Aug 2026 18:43:03 -0400 Subject: [PATCH 3/6] Run PHP CI on 8.3 --- .github/workflows/php-ci-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php-ci-tests.yml b/.github/workflows/php-ci-tests.yml index 2ee6195a..006204c6 100644 --- a/.github/workflows/php-ci-tests.yml +++ b/.github/workflows/php-ci-tests.yml @@ -21,7 +21,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' tools: composer:v2, cs2pr - name: Install dependencies @@ -42,7 +42,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' tools: composer:v2 - name: Install dependencies From e9f160671f8c00596819c358a21270f7d2b5c6f3 Mon Sep 17 00:00:00 2001 From: "Daniel L. Iser" Date: Thu, 13 Aug 2026 18:46:17 -0400 Subject: [PATCH 4/6] Isolate Strauss from CI auth --- .github/workflows/php-ci-tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/php-ci-tests.yml b/.github/workflows/php-ci-tests.yml index 006204c6..e2abf1b8 100644 --- a/.github/workflows/php-ci-tests.yml +++ b/.github/workflows/php-ci-tests.yml @@ -46,7 +46,10 @@ jobs: tools: composer:v2 - name: Install dependencies - run: composer install --no-progress --no-suggest + run: | + composer install --no-progress --no-suggest --no-scripts + COMPOSER_AUTH='{}' composer run-script strauss + composer dump-autoload - name: Run PHPStan run: composer run phpstan From cc0251ca685439c6f211ff412b00217c9f78493d Mon Sep 17 00:00:00 2001 From: "Daniel L. Iser" Date: Thu, 13 Aug 2026 18:47:27 -0400 Subject: [PATCH 5/6] Clear Composer auth before Strauss --- .github/workflows/php-ci-tests.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php-ci-tests.yml b/.github/workflows/php-ci-tests.yml index e2abf1b8..1b023585 100644 --- a/.github/workflows/php-ci-tests.yml +++ b/.github/workflows/php-ci-tests.yml @@ -25,7 +25,11 @@ jobs: tools: composer:v2, cs2pr - name: Install dependencies - run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader --no-interaction + run: | + composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader --no-interaction --no-scripts + unset COMPOSER_AUTH + composer run-script strauss + composer dump-autoload - name: Run PHP Code Sniffer run: vendor/bin/phpcs --standard=.phpcs.xml.dist -q --report=checkstyle | cs2pr @@ -48,7 +52,8 @@ jobs: - name: Install dependencies run: | composer install --no-progress --no-suggest --no-scripts - COMPOSER_AUTH='{}' composer run-script strauss + unset COMPOSER_AUTH + composer run-script strauss composer dump-autoload - name: Run PHPStan From ca897bf965be364be3efe0e56900b645dab614e0 Mon Sep 17 00:00:00 2001 From: "Daniel L. Iser" Date: Thu, 13 Aug 2026 18:50:33 -0400 Subject: [PATCH 6/6] Use clean Composer home for Strauss --- .github/workflows/php-ci-tests.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/php-ci-tests.yml b/.github/workflows/php-ci-tests.yml index 1b023585..b9865485 100644 --- a/.github/workflows/php-ci-tests.yml +++ b/.github/workflows/php-ci-tests.yml @@ -27,8 +27,9 @@ jobs: - name: Install dependencies run: | composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader --no-interaction --no-scripts - unset COMPOSER_AUTH - composer run-script strauss + test -f strauss.phar || curl -o strauss.phar -L -C - https://github.com/BrianHenryIE/strauss/releases/download/0.16.0/strauss.phar + mkdir -p /tmp/strauss-composer-home + env -u COMPOSER_AUTH -u GITHUB_TOKEN COMPOSER_HOME=/tmp/strauss-composer-home php strauss.phar composer dump-autoload - name: Run PHP Code Sniffer @@ -52,8 +53,9 @@ jobs: - name: Install dependencies run: | composer install --no-progress --no-suggest --no-scripts - unset COMPOSER_AUTH - composer run-script strauss + test -f strauss.phar || curl -o strauss.phar -L -C - https://github.com/BrianHenryIE/strauss/releases/download/0.16.0/strauss.phar + mkdir -p /tmp/strauss-composer-home + env -u COMPOSER_AUTH -u GITHUB_TOKEN COMPOSER_HOME=/tmp/strauss-composer-home php strauss.phar composer dump-autoload - name: Run PHPStan