Hey all, this CFCOMPAT issue that Adobe released a...
# lucee
i
Hey all, this CFCOMPAT issue that Adobe released a fix for https://helpx.adobe.com/coldfusion/kb/coldfusion-2021-update-14.html is also an issue in Lucee. I posted a security advisory to Lucee gang back in Feb when I reported to Adobe but they never responded. I sent DMs, email to the security address and @messages to them on Github. They must be busy. The issue is that Coldfusions default encrypt / decrypt also is so broken that you can get it by brute forcing at most 4 chars regardless of the size of the secret. In some case, you can do it in as little as 1. https://trycf.com/gist/dd724f70d519f5d2ddc30755012581e9/lucee6-beta?theme=monokai Note that Mura/Masa will need to update that as I believe they use the default for encrpyting remember me passwords or something.
b
Not to nitpick, but it's more that CFMX_COMPAT is very weak algorithm with a 32-bit key (hence only needing to bruteforce 4 characters) rather than being "broken". AFAIK - it's been documented for a long time and in many places that you really shouldn't use it, and it's just there for legacy support
👍 1
This is a great writeup on the crypto weakness in CFMX_COMPAT -https://www.synacktiv.com/en/publications/coldfusion-cfmx_compat-lolcryption - although the one-character edge case is new to me / a nice find 😄
i
Lucee also tries to set a default key. I wonder what the reason was for that: https://github.com/lucee/Lucee/blob/6.1/core/src/main/java/lucee/runtime/crypt/CFMXCompat.java#L87 Which if I remember correctly, only doesn't get used because of a code error in that file.
if (StringUtil.isEmpty(key)) key = "Default Seed";
This would mean (if working) that when you pass in a nullValue or empty string, it would be able to decrypt the text using the default "Default Seed". It seems this code doesn't work as intended. This is probably because it sets the key into another variable and then sets the default.
m_Key = key; if (StringUtil.isEmpty(key)) key = "Default Seed";
👀 1
b
I agree with Brian's point. Here is an <a href="https://www.andrewdixon.co.uk/2020/09/19/using-argon2-in-lucee-cfml/">article by Andrew Dixon</a> suggesting Argon2 as a recommended algorithm for password hashing. It uses random generated salts, but considered far more secure. Outside of CF, here is a <a href="https://support.dwolla.com/s/article/Dwolla-s-Password-Hashing-Requirements">quick article from Dwolla</a> on their recommendation for password hashing.