[Looking for Charlie's main web site?]

Announcing ColdFusion updates released June 11 2024: another possible breaking change

This is another important heads-up for my readers: there was an important security update released today by Adobe for ColdFusion 2023 (its update 8) and ColdFusion 2021 (its update 14). Just like the recent CF updates in March, this one again has a potential breaking change (trading away compatibility for the sake of security), and it adds yet another JVM arg that allows you to "revert" to the previous default behavior--to let you benefit from OTHER security aspects of the update, while you give time to addressing what should be changed.

In this case, it's about if you use CF encryption-related functions, the default encryption algorithm is changing--and that means that those who encrypt/decrypt (or hash or randomize) data in their apps MUST take steps before applying this updates. For more, read on.

Update: As a heads-up, a few weeks after this post ANNOUNCING the update and its key change, I created another that address confusion many still seem to have after reading the Adobe technote on the update (links below).You may want to skip to reading that post first, On handling the June 2024 CF update change of default algorithm from CFMX_COMPAT.

Otherwise, read on for what I wrote originally.

[....Continue Reading....]

Comments
An update since the original post: someone kindly informed me (directly, rather than as a comment here) that the technote has a mistake, where it has a space before the "=" in the assignment for the JVM arg. And if you don't remove that, CF won't start if you use it that way!

So I've added an update to my post above about this.

And if you are the person who sent me word, please send it again. It was early in my day here at cfcamp in Germany, and I can't recall how you had sent it. I looked through several places before writing this! :-)
I am doing an upgrade from 2016 and Migration wizard brought over datasources just fine. I upgraded to CF2023 update 8 added the Compat jvm arg, restarted the service, but the DSNs will not validate until I rekey the password. CF throws the below error. so it seems like the argument is not working unless I am missing something.

Error below:
errorError editing/creating this dsn (dsn-name)
An error occurred while trying to encrypt or decrypt your input string: Given final block not properly padded. Such issues can arise if a bad key is used during decryption..
# Posted By Mike Collins | 6/14/24 10:13 AM
In reading the security bulletin and other info related to this update, I understood the change to be that CFMX_COMPAT would simply no longer be the default encryption algorithm. I presumed if the optional algorithm parameter was supplied that the encrytion would still work without setting the JVM argument -Dcoldfusion.encryption.useCFMX_COMPATAsDefault=TRUE in the ColdFusion Administrator. For example. where local.algorithm is set to "CFMX_COMPAT" :

    local.result = encrypt(arguments.fromString, getKey(arguments.algorithm), local.algorithm, local.encoding );

However, that does not appear to be the case. The encryption actually works, but not without the "...error occurred while trying to encrypt or decrypt your input string: '' Can not decode string..." warning.

Has anyone else encountered this?
# Posted By Vicki | 7/9/24 10:17 AM
Vicki, things do indeed work the way the technote indicates. If you're finding otherwise, I would suggest you confirm that your "local.algorithm" variable does have the value you think it does. :-)

But more specifically, here is code that will demonstrate that things work if (as you propose) one DOES set the 3rd arg (for encrypt or decrypt) to "cfmx_compat", and this works whether you set the jvm arg true or false or if you leave it off. Notice how my code outputs whether that's so, as well as the CF version and update level.

<cfscript>
msg="test msg"
algo="cfmx_compat"
key="123"
writeoutput("Message to encrypt:" & msg & '<hr>')
encryptedMsg = encrypt(msg,key, algo)

decryptedMsg = decrypt(encryptedMsg,key, algo)
writeoutput("Decrypted message:" & decryptedMsg & "<hr>")

writeoutput("CF version: " & server.coldfusion.productversion & "<hr>")
writeOutput("JVM arg -Dcoldfusion.encryption.useCFMX_COMPATAsDefault")
if (not structKeyExists(server.system.properties,"coldfusion.encryption.useCFMX_COMPATAsDefault")) {
writeoutput(" <u>is not set</u>")
}
else {
writeoutput("=" & server.system.properties["coldfusion.encryption.useCFMX_COMPATAsDefault"])
}
</cfscript>

Please let us know how things go.
Thanks, Charlie, as always. I have determined that what I originally assumed and what you stated is, of course, true. I also had already confirmed my "local.algorithm" variable had the value I expected. In the end, I believe the issue I experienced was a caching issue! In any event, all is good in my world now. Thank you most kindly for your assistance!
# Posted By Vicki | 7/12/24 10:00 AM
Good to hear, and as some would say, indeed "both things can be true". :-)
Right on!
# Posted By Vicki | 7/12/24 11:42 AM
Copyright ©2025 Charlie Arehart
Carehart Logo
BlogCFC was created by Raymond Camden. This blog is running version 5.005.
(Want to validate the HTML in this page?)

Managed Hosting Services provided by
Managed Dedicated Hosting