Make WordPress Core

Opened 7 minutes ago

Last modified 4 minutes ago

#66650 new task (blessed)

Upgrade sodium_compat to version 1.24.2

Reported by: desrosj Owned by:
Priority: normal Milestone: 7.2
Component: External Libraries Version:
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

Core currently bundles sodium_compat@1.24.1, which was updated in #65903 for 7.2.

The latest version on the v1.x branch is now ​1.24.2, released on August 18, 2026.

This is a hardening release.

Full diff: ​https://github.com/paragonie/sodium_compat/compare/v1.24.1...v1.24.2

Previous:

Change History (1)

This ticket was mentioned in ​PR #15883 on ​WordPress/wordpress-develop by ​@desrosj.


4 minutes ago
#1

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.

Changes

1.24.2 backports cryptographic boundary and validation fixes from the 2.x branch (​sodium_compat#209):

  • Ed25519: verify_detached() rejects public keys of small order, and restores the fastMult setting if an exception is thrown. This applies to both the 64-bit (Core) and 32-bit (Core32) implementations.
  • ChaCha20: throws when the block counter overflows, and handles counter wraparound correctly, so an exhausted counter can't reuse the keystream. This applies to both implementations.
  • SecretStream: the rekey check uses the full 32-bit counter mask, 0xffffffff instead of 0xffff.
  • Ristretto255: inverting a zero scalar throws.
  • ParagonIE_Sodium_File: box_open() and the related methods decrypt into a temporary file, and only write to the destination after authentication succeeds.

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.

1.24.2 doesn't include any changes for PHP 8.6 compatibility.

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.
  • I haven't run PHPUnit locally. CI on this PR is the first run.

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

​https://claude.ai/code/session_011Y86gx1T9qpKZuJWesSGiZ

Note: See TracTickets for help on using tickets.