[TagAwareCipher] - Decryption Failure (Regex Match)
Low severity
GitHub Reviewed
Published
Mar 16, 2024
in
IlicMiljan/Secure-Props
•
Updated Mar 19, 2024
Package
Affected versions
>= 1.2.0, < 1.2.2
Patched versions
1.2.2
Description
Published to the GitHub Advisory Database
Mar 18, 2024
Reviewed
Mar 18, 2024
Published by the National Vulnerability Database
Mar 18, 2024
Last updated
Mar 19, 2024
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 toTagAwareCipher
, 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 hasNullEncoder
(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 withTagAwareCipher
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
usesBase64Encoder
by default.References
Reported issue: IlicMiljan/Secure-Props#20
Pull request resolving bug: IlicMiljan/Secure-Props#21
References