Skip to content

Fix. Code. Editing the check_value parametere#813

Open
AntonV1211 wants to merge 4 commits into
devfrom
vuln_check_value_fix
Open

Fix. Code. Editing the check_value parametere#813
AntonV1211 wants to merge 4 commits into
devfrom
vuln_check_value_fix

Conversation

@AntonV1211

Copy link
Copy Markdown
Contributor

Copilot AI review requested due to automatic review settings June 17, 2026 12:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the plugin’s “cookies test” checksum logic to incorporate an additional salt value, strengthening the integrity check used to validate client-side cookies.

Changes:

  • Update apbct_cookie() to seed check_value with api_key + salt.
  • Update apbct_cookies_test() to validate the cookie checksum using api_key + salt.
Comments suppressed due to low confidence (1)

cleantalk.php:2735

  • $apbct->salt is not set on the global state object (salt is stored as $apbct->data['salt']), so this will raise an undefined property notice and may compute an incorrect cookie-test hash. Also, changing the hash input will invalidate existing apbct_cookies_test cookies; accepting the legacy (unsalted) checksum as a fallback avoids breaking in-flight form submissions right after an update.
        $check_string = $apbct->api_key . $apbct->salt;
        // generate value
        $cookie_names = TT::getArrayValueAsArray($cookie_test, 'cookies_names');
        foreach ( $cookie_names as $cookie_name ) {
            $check_string .= Cookie::get($cookie_name);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cleantalk.php
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 26.52%. Comparing base (87317d1) to head (27cba83).
⚠️ Report is 9 commits behind head on dev.

Files with missing lines Patch % Lines
cleantalk.php 66.66% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (66.66%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##                dev     #813      +/-   ##
============================================
+ Coverage     26.41%   26.52%   +0.11%     
- Complexity     5655     5667      +12     
============================================
  Files           268      269       +1     
  Lines         24220    24240      +20     
============================================
+ Hits           6398     6430      +32     
+ Misses        17822    17810      -12     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI review requested due to automatic review settings June 18, 2026 04:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread cleantalk.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants