Skip to content

External Libraries: Update sodium_compat to v1.24.2. - #15883

Closed
desrosj wants to merge 1 commit into
WordPress:trunkfrom
desrosj:update/sodium-compat-1.24.2
Closed

desrosj wants to merge 1 commit into
WordPress:trunkfrom
desrosj:update/sodium-compat-1.24.2

Conversation

@desrosj

@desrosj desrosj commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Updates the bundled sodium_compat library from 1.24.1 to 1.24.2, the latest release on the v1.x branch that WordPress uses.

This update is a hardening release.

Trac ticket: https://core.trac.wordpress.org/ticket/66650

WordPress only loads sodium_compat when the native Sodium extension isn't available (! function_exists( 'sodium_crypto_box' ) in wp-includes/compat.php). These fixes only take effect on those sites.

How this follows previous updates

  • WordPress bundles the files under lib/, namespaced/ and src/, plus autoload.php, autoload-php7.php, composer.json and LICENSE. That's 108 files, and upstream's tests and build tooling are left out.
  • 1.24.2 adds no new files. Upstream has no files in those directories that WordPress leaves out, so the missing files problem from the 1.21.1 update ([58753]) can't happen here.
  • 9 files changed upstream, and all of them are updated.
  • Before this change, 107 of the 108 files were identical to upstream v1.24.1. The exception is src/Core/Curve25519.php, which was missing its trailing newline in r63397. This PR restores the newline, so all 108 files now match upstream v1.24.2 byte for byte.
  • The commit message follows r63397 (1.24.1), and adds that revision to the Follow-up to list.

Testing

  • php -l passes on the changed files under PHP 8.6.0-dev.
  • vendor/bin/phpcs --standard=phpcompat.xml.dist src/wp-includes/sodium_compat/ is clean.
  • vendor/bin/phpcs src/wp-includes/sodium_compat/ is clean.
  • All bundled files match upstream v1.24.2 byte for byte.

Use of AI Tools

  • AI assistance: Yes
  • Tool(s): Claude Code
  • Model(s): Claude Opus 5.5
  • Used for: reviewing past sodium_compat updates, comparing the bundled files with upstream, reading the 1.24.1 to 1.24.2 diff, running the checks above, and drafting this description. I reviewed the result.

🤖 Generated with Claude Code


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

The latest version backports several cryptographic boundary and validation fixes:

* Ed25519 signature verification now rejects public keys of small order.
* ChaCha20 now throws an exception when the block counter overflows, instead of reusing the keystream.
* The SecretStream rekey check now uses the full 32-bit counter.
* Ristretto255 now throws an exception when inverting a zero scalar.
* `ParagonIE_Sodium_File::box_open()` and related methods now only write to the destination file after the ciphertext has been authenticated.

This also restores the trailing newline at the end of `src/Core/Curve25519.php`, which was lost in r63397, so that all bundled files are identical to the upstream release.

References:
* [https://github.com/paragonie/sodium_compat/releases/tag/v1.24.2 sodium_compat 1.24.2 release notes]
* [paragonie/sodium_compat@v1.24.1...v1.24.2 Full list of changes in sodium_compat 1.24.2]

Follow-up to r55699, r58752, r58753, r60787, r60905, r61419, r63397.

Props desrosj.
Fixes #66650.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011Y86gx1T9qpKZuJWesSGiZ
@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@desrosj desrosj self-assigned this Nov 10, 2026
@desrosj
desrosj marked this pull request as ready for review November 10, 2026 15:35
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props desrosj.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@desrosj desrosj changed the title Upgrade/Install: Update sodium_compat to v1.24.2. External Libraries: Update sodium_compat to v1.24.2. Nov 10, 2026
@github-actions

Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 65398
GitHub commit: c455619

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions Bot closed this Nov 10, 2026
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.

2 participants