GitHub Advisoryadvisory · Packagist
GHSA-rj29-j2g4-77q8 [TagAwareCipher] - Decryption Failure (Regex Match)
LOW
Official page ↗
- Aliases
- CVE-2024-28864
- Ecosystem
- Packagist
- Packages
- ilicmiljan/secure-props
- Severity
- Low
- CVSS vector
- CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:N
- Weaknesses
- CWE-1333
- Reviewed
- 2024-03-18
Affected packages
• Packagist ilicmiljan/secure-props: >= 1.2.0, < 1.2.2 → fixed in 1.2.2
Description
Impact
Vulnerability in SecureProps involves a regex failing to detect tags during decryption of encrypted data.
This occurs when the encrypted data has been encoded with `NullEncoder` and passed to `TagAwareCipher`, and contains special characters such as `\n`. As a result, the decryption process is skipped since the tags are not detected. This causes the encrypted data to be returned in plain format.
The vulnerability affects users who implement `TagAwareCipher` with any base cipher that has `NullEncoder` (not default).
Patches
The patch for the issue has been released. Users are advised to update to version 1.2.2.
Workarounds
The main recommendation is to update to the latest version as there are no breaking changes.
If that's not possible, you can use the default `Base64Encoder` with the base cipher decorated with `TagAwareCipher` to prevent special characters in the encrypted string from interfering with regex tag detection logic.
This workaround is safe but may involve double encoding since `TagAwareCipher` uses `Base64Encoder` by default.
References
Reported issue: https://github.com/IlicMiljan/Secure-Props/issues/20
Pull request resolving bug: https://github.com/IlicMiljan/Secure-Props/pull/21
Related
Alias · CVE (1)
- CVE-2024-28864 SecureProps is a PHP library designed to simplify the encryption and decryption of property data in objects. vulnerability
Weakness · CWE (1)
- CWE-1333 Inefficient Regular Expression Complexity weakness
References
- https://github.com/IlicMiljan/Secure-Props/security/advisories/GHSA-rj29-j2g4-77q8 web
- https://nvd.nist.gov/vuln/detail/CVE-2024-28864 advisory
- https://github.com/IlicMiljan/Secure-Props/issues/20 web
- https://github.com/IlicMiljan/Secure-Props/pull/21 web
- https://github.com/IlicMiljan/Secure-Props/commit/ab7b561040cd37fda3dbf9a6cab01fefcaa16627 web
- https://github.com/IlicMiljan/Secure-Props package