Skip to content

CP-17090 crypt decrypt hmac#17091

Merged
niden merged 6 commits into
5.0.xfrom
CP-17090-crypt-decrypt-hmac
Jun 8, 2026
Merged

CP-17090 crypt decrypt hmac#17091
niden merged 6 commits into
5.0.xfrom
CP-17090-crypt-decrypt-hmac

Conversation

@niden

@niden niden commented Jun 7, 2026

Copy link
Copy Markdown
Member

Hello!

In raising this pull request, I confirm the following:

  • I have read and understood the Contributing Guidelines
  • I have checked that another pull request for this purpose does not exist
  • I wrote some tests for this PR
  • I have updated the relevant CHANGELOG
  • I have created a PR for the documentation about this change

Fixed Phalcon\Encryption\Crypt::decrypt() to verify the HMAC tag with the constant-time hash_equals() instead of the identity operator, removing an observable timing discrepancy in the tag comparison (CWE-208, CWE-347) . The tag is now also verified before the decrypted text is unpadded, and truncated tags are rejected by the unequal-length path of hash_equals().

Thanks

niden added 6 commits June 6, 2026 23:13
Assisted-by: Claude Code
Assisted-by: Claude Code
Assisted-by: Claude Code
Assisted-by: Claude Code
@niden niden requested a review from Jeckerson June 7, 2026 22:24
@niden niden self-assigned this Jun 7, 2026
@niden niden added bug A bug report status: high High 5.0 The issues we want to solve in the 5.0 release labels Jun 7, 2026
@niden niden changed the title Cp 17090 crypt decrypt hmac CP-17090 crypt decrypt hmac Jun 7, 2026
@niden niden merged commit ad53ab1 into 5.0.x Jun 8, 2026
382 of 384 checks passed
@niden niden deleted the CP-17090-crypt-decrypt-hmac branch June 8, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5.0 The issues we want to solve in the 5.0 release bug A bug report status: high High

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants