Copy link to clipboard
Copied
Hi, all. I'm doing an update soon to include a hotfix that references this JVM flag. I'm not a Java guy, so please excuse the question if it is ridiculous, Everywhere I read about this flag on the Web, the purpose is stated something like this: "...this flag prevents ColdFusion from executing pre-compiled CFML code (Java bytecode) at runtime."
This confuses me, because ColdFusion works by executing precompiled Java bytecode at runtime, right? It would be very inefficient if it did not. A Google search for the flag indicates such bytecode is in "older" code, but CF's uses precompilation to this day. I've already installed the hotfix on a dev server and my code still works, even when "save class files" is turned on in the CF admin, so I'm guessing this JVM flag only applies to a different kind of precompiled java bytecode. If so, what kind? How might I determine whether there is any of this Java bytecode present in my (large, inherited) application?
Thanks!
It's a great question, Dordrecht--and one that has long needed better clarification. It's indeed easy to be confused about it, beyond just what you asked. Let me elaborate.
I'm afraid it's not a simple answer, but you may find my points 1 and 2 sufficient for your question. 🙂 I hope the rest may help you or others seeking info on the matter. As you say, it's been hard to come by.
1) First, yes this is about whether CF can execute java bytecode stored within cfml files. Traditionally that's
...Copy link to clipboard
Copied
It's a great question, Dordrecht--and one that has long needed better clarification. It's indeed easy to be confused about it, beyond just what you asked. Let me elaborate.
I'm afraid it's not a simple answer, but you may find my points 1 and 2 sufficient for your question. 🙂 I hope the rest may help you or others seeking info on the matter. As you say, it's been hard to come by.
1) First, yes this is about whether CF can execute java bytecode stored within cfml files. Traditionally that's been enabled (precompiled) using the cfcompile script in cfusion/bin. Many never use it or don't know it exists. This is a mechanism that CF had for many releases where developers could precompile their CFML pages such that they remained a .cfm (or .cfc) file, but the CFML was converted to the unreadable java byte code. (You would be expected to have saved the "real" source in another folder, and precompile it to place it into the folder where your CFML files would normally be executed from.)
This was a form of "security by obscurity", but more important it was determined that it could be abused. Indeed, it's even possible for one to compile java bytecode and then PLACE it in a cfm or cfc file, and CF would run it. And the issue there is that such java bytecode would not be run through the samelow-level java classes that Adobe has in place for processing CFML code--such that, for example, if one used the CF Sandbox feature (another long-existing but generally little-used feature) to limit what tags could be executed in that CF instance (or limitable to a specific code directory), such bytecode could circumvent that protection. Is it something of grave concern?
Well, if someone can put untrusted code on your server that's already an issue. The bigger concern here is for those who ARE using that sandbox feature to limit what CFML code can do (such as perhaps shared hosting providers, but indeed anyone using the CF security sandbox feature).
For more on this, see the Brian Reilly's June 2025 post (on his "hoyahaxa" blog), specifically this post. The title may not readily connect that it's discussing this matter, but it is. And it does a very thorough job of explaining the issue. (Indeed, Brian is the one who found the vulnerability and reported it to Adobe. He waited a couple of months before posting the blog entry, in the hopes people would have applied the needed updates by then.)
1a) So indeed it has NOTHING to do with CF's execution of the bytecode which CF creates dynamically (when running a CF page for the first time after it's been created or edited). And to be clear, yes THAT bytecode is saved as .class files in the cfclasses folder--by default, as configurable in the CF Admin "caching" page and the "save class files" setting. But even if that settings is DISABLED, CF does still compile CFML to bytecode, which is then loaded into memory (the "template cache", which cannot be disabled). But again, that is NOT what this change was about (which is only about cfm/cfc files with bytecode). Those .class files in cfclasses are not affected at all, so you can relax regarding what seemed your primary concern here.
2) So as for the jvm arg and this vulnerability, a change was introduced in the April 2025 updates to 2023 (update 13) and 2021 (update 19)--and was already built into CF2025 (released in Feb 2025). Now by default (as of these updates to CF2023 or 2021--or as of CF2025 from its release), such bytecode in cfml files (precompiled templates) would NO LONGER be able to execute, by default: they are "blocked".
2a) And this is why the jvm arg exists, to "unblock" that default protection (changing it from TRUE to FALSE), for all files CF may process. This should not be done without considering the concern in Brian's post.
2b) And note that there is in fact a way to instead identify WHAT folders ARE allowed to hold (and let CF execute) such precompiled templates. More on that in a moment. Again, some developers use this feature--but they may use it only in some folders.
3) As an aside, the April 2025 update technotes for 2023 and 2021 only LISTED this new arg but didn't explain it at all. See for instance the update technote for CF2023 update 13: https://helpx.adobe.com/coldfusion/kb/coldfusion-2023-update-13.html. (Again, the change and arg was already IN CF2025 update before its update 1 that month.)
3a) Indeed, then in the May 2025 update technotes (for all 3 versions), Adobe explained that those April updates (all 3 versions) had introduced a new pathfilter.txt file (in cfusion/lib or [instance]/lib), which was the initial way you could DEFINE the path of files where you WOULD want CF to be able to execute such precompiled templates (to creates a "whitelist").
3b) BTW, this older pathfilter.txt is not to be confused with the serialfilter.txt and cfserialfilter.txt, which were introduced in still-earlier CF updates. More on them at https://helpx.adobe.com/coldfusion/kb/coldfusion-serialfilter-file.html.
4) And that May 2025 update technote ALSO clarified that that update was changing it to be a new pathfilter.json file instead (in the same folder) that was to be used for such whitelisting. The reason for the change was that now this file was controlling not just that behavior above but other behavior where CF was limiting what folders could be used for certain features. See that May 2025 technote (for your CF version) for more on that pathfilter.json file.
And to be clear, the file itself has comments that try to help you set it up: but I will warn that you need to be very careful about the paths specified in that file, for things to work as you'd expect. For example, the path is case-sensitve (even on Windows), including the drive letter. Also, the path separators must be specified as / rather than \, again even on Windows. Sadly, it leads to a lot of confusion.
4a) While we're on the topic of this pathfilter.json file, note that subsequent updates (including the one from Dec 2025) have added still MORE things whose files/folders that json file can whitelist (whether you could run encoded/encrypted templates, whether scheduled tasks can publish output as defined in the task, whether cf admin proves can create output, etc.)
5) Still ANOTHER concern to beware of about this pathfilter.json file (if you opt to use it for such whitelisting) is that, on subsequent updates (even as of the Dec 2025 update), if you have edited the file and apply an update, the update REPLACES the file with a default one that has NO whitelisting: you will lose what you have entered.
The technotes do indeed warn of this for the updates from July 2025, forward, suggesting that you to either make a copy BEFORE the update or noting how you can recover the content from the hf-updates folder for that update found in your cfusion or [instancename] folder), where there will be a folder for the update you applied, and within that is a "backup" folder, which will have the old version fo the file in its lib folder.
just beware: since an older update may have offered fewer options of what can be whitelisted than a later update, you should MERGE your old content into the new pathfilter.json file, rather than REPLACE it. The technotes are NOT clear about that.
6) One more thing on this jvm arg in particular that you ask about, I will note that another source of confusion on this is in fact a problem on the jvm args page discussing this and other new jvm args. For instance, in the page for the 2025 version of the args, it mistakenly indicates in the "description" column (the column header itself) the words:
"If true, the flag prevents ColdFusion from dynamically compiling CFML code into Java bytecode at runtime."
But then for this arg, the description column instead says:
"If true, the flag prevents ColdFusion from executing pre-compiled CFML code (Java bytecode) at runtime."
That first mistaken sentence leads to the sort of confusion you shared (about CF itself compiling code at runtime). Note that the second one instead makes it more clear that it's about this *PRE-COMPILED CFML code", which was the subject of that change in April (or in CF2025 in Feb).
i will raise that concern to Adobe to see if they can correct it.
7) While it's not discussed in the technotes, I'll share that there has been at least one other situation where you may need to use either the jvm arg (to disable the blocking of precompiled templates) or use the pathfilter.json--to allow whitelisting of files you wouldn't have precompiled yourself.
First note that the CF Admin itself does use such precompiled templates, as a way that Adobe discourages folks looking into the CFML code for the Admin. And they have indeed internally already whitelisted the needed CF Admin folder locations (CFIDE/administrator, CFIDE/adminapi, etc.)
But there have been situations where people found that their admin could not load, with it reporting the error about not being able to execute such precompiled code. My observation has been that this is either in deployment of CFML as WAR files (on JEE servers and servlet engines) or sometimes when using multiple instances (this is a feature for those on CF Enterprise or the Developer edition, where the CF Admin "Enterprise Manager" page allows creation of multiple instances). But I have NOT seen the problem ALWAYS happen with such newly created instance.
Anwyay, in those cases where the error occurs, again you could either use the JVM arg to disable the blocking of precompiled code, or add the path to the administrator folders (which will be named in the error) to the whitelist in the pathfilter.json file.
8 ) Finally (yes, finally!), your last question asked, "How might I determine whether there is any of this Java bytecode present in my (large, inherited) application?" Of course, you may no longer need to know since you might have been thinking of something else. But someone else reading this answer may well wonder, "how can I find files in our environment that might be such precompiled cfm or cfc files?"in anticipation of a planned implementation of the April 2025 updates or beyond for CF2023 or 2021 , or a move to CF2025.
There may be better ways, but I'll say that if you use any good file search tool or editor feature, look for files (with the filename pattern of *.cf*, for instance) which contain the text "sourcefile". That is a string (one of the few reliable ones) that would exist in such precompiled templates. They will be binary also, so if you open the file (in the result of the search) and its clear text, then that's a false positive (a file containing that word but NOT precompiled). It's not perfect, but it's better than nothing.
As Brian Reilly's blog post notes, you can also look for the hex string CAFEBABE appearing as the first characters of the file, if your search feature might support searching via hex strings. 🙂
9) So in summary, I know that was a VERY long answer to your question, but I hope you can appreciate that it's the lack of anything from Adobe or much from anyone else explaining all of it that indeed deserves this kind of discussion. I welcome feedback from you or anyone coming across this thread in the future. (And then I would like to create a blog post out of it. I have long meant to. For now I opted to write this here since you raised the great question.)
Copy link to clipboard
Copied
Thank you, @Charlie Arehart, for yet another a full-orbed clarification of a troubling question. The time and thought you put into your responses is always excellent and appreciated.
Copy link to clipboard
Copied
Glad to have helped, thanks for the kind regards, and thanks also for marking the reply as an answer.
And do you feel now that you are able to proceed, with the better understanding of things. Or are there perhaps any remaining doubts?
BTW, after a night's sleep I see some modest tweaks I want to make to better clarify my answer. Anyone interested to determine "what did I change" can use the available "view history" button offered under each reply via its "more" button.
Copy link to clipboard
Copied
Hi @Dordrecht ,
@Charlie Arehart's response is comprehensive and touches on the main points of your question. I have a different perspective.
First of all, your question is certainly not ridiculous. It is in fact important. After all, the JVM flag concerns the security of your server.
There is no contradiction. The first statement should actually have read,
The new security measure to enforce the path authorization is the setting "bytecodeexecutionpaths". It specifies a whitelist of directory paths from which the server is permitted to execute precompiled Java bytecode. The setting is in the configuration file pathfilter.json discussed by Charlie. Its default location is /lib/pathfilter.json. Check it out.
The default setting is:
"bytecodeexecutionpaths": ""
As C:\\ColdFusion\\cfusion\\wwwroot\\WEB-INF\\cfclasses\\* is not on this list, why then is ColdFusion able to run the class files? Answer: because this particular directory is authorirized by default and trusted by ColdFusion. With -Dcoldfusion.compiler.block.bytecode=true enabled, if ColdFusion attempts to run Java bytecode that is on some other path that is not listed in "bytecodeexecutionpaths", an exception will occur.
Now, on to the question of determining whether there is any Java bytecode representing CFML files located anywhere in a legacy application. I would do it manually, as a separate project, away from the application, as follows:
Copy link to clipboard
Copied
Thank you, @BKBK. This was very helpful.
Copy link to clipboard
Copied
My pleasure, @Dordrecht . Glad to have helped.
Copy link to clipboard
Copied
I'd like to add a few thoughts in reply to bkbk's counterpoint.
1) First, thanks for your acknowledgment in the first sentence. As for your then saying to dordrecht that " your question is certainly not ridiculous", I just want to make clear that I didn't say it was nor did my reply convey that. I get that you maybe did not mean to imply that, but I want to make it clear. Especially since I'm going to tweak my reply to him a bit, after a night's sleep.
And you make a good point that the Adobe resources should clarify that this change (and the jvm arg) affects running such precompiled code "from an untrusted or unauthorized path". It would be nice if they'd clarify that.
And yep, that bytecodeexecutionpaths element in the pathfilter.json is indeed what I was referring to. As I'd noted, the technote was meager and the default content in the file itself is for now all we have. But sure, since this post will for now be the next best discussion of things, it's good for you to have clarified that is the specific element in the file that's related to this matter.
2) But finally (and I think more important), I do have to counter the rest of what you offered to dordrecht, in your final section on "determining whether there is any Java bytecode representing CFML files located anywhere in a legacy application". Your whole premise there is on finding .jar or .class files (other than in cfclasses) that hold the compilation of cfml code. Well, no. There's no need for that effort.
Such .class files are NOT what this change is about. To be clear, it's about cfm or cfc files...which may hold WITHIN them bytecode....which is done traditionally by the cfcompile script in cfusion's bin. But as Brian's post (which I pointed to) made clear and actually demostrates, the problem is that someone could also just copy such bytecode (of their own creation) into such a .cfm or .cfc file. (And even then, the main concern he was raising was that then such code might be able to do things that the CF Sandbox feature would have otherwise prevented executing at runtime. His observation was that such compiled bytecode in a cfc or cfm file circumvents that sandbox protection, if enabled.)
Anyway, the main point of contention I'm making here (regarding your suggesiton that he search for and start decompiling .class files) is that it's just not necessary: there's no way that CF will execute a .class file. That's not a feature of CF. Again the protection of this recent change is merely to prevent running of cfm or cfc files which CONTAIN such bytecode.
And so yes, the challenge some might have is finding any such .cfc, .cfm, .cfml files (but NOT .class files) holding such bytecode, if they wonder whether the new default blocking of that would affect those. And that is indeed why I proposed searching for *.cf* files.
3) Finally, as for your suggesting those other strings ("import coldfusion.runtime.CFPage", "import coldfusion.runtime.CfJspPage" and "import coldfusion.runtime.CFComponent"), that's reasonable. I had proposed more simply just searching for the "sourcefile" string as that's also common to such bytecode and would likely be rare in a cfm file otherwise. But sure, if somehow searching for "sourcefile" turned up too many false positives (and someone's search tool can handle OR'ing multiple strings), those are even better choices.
As always, just trying to help...not to be argumentative or needlessly nitpicky. I thought the clarification (my point 2 here) about not needing to worry about .class files was very important to point out, as the bulk of your reply related to that. Don't forget that my points 1 and 3 are being supportive of what you added.
And certainly if there's anything I've asserted here which is incorrect, I welcome correction.
Copy link to clipboard
Copied
I'd like to add a few thoughts in reply to bkbk's counterpoint.
1) First, thanks for your acknowledgment in the first sentence. As for your then saying to dordrecht that " your question is certainly not ridiculous", I just want to make clear that I didn't say it was nor did my reply convey that. I get that you maybe did not mean to imply that, ... etc. etc.
By @Charlie Arehart
@Charlie Arehart , my post was not intended as a counterpoint to yours. As I said, it represents my own perspective.
Copy link to clipboard
Copied
2) But finally (and I think more important), I do have to counter the rest of what you offered to dordrecht, in your final section on "determining whether there is any Java bytecode representing CFML files located anywhere in a legacy application". Your whole premise there is on finding .jar or .class files (other than in cfclasses) that hold the compilation of cfml code. Well, no. There's no need for that effort.
Such .class files are NOT what this change is about. To be clear, it's about cfm or cfc files...which may hold WITHIN them bytecode....which is done traditionally by the cfcompile script in cfusion's bin. But as Brian's post (which I pointed to) made clear and actually demostrates, the problem is that someone could also just copy such bytecode (of their own creation) into such a .cfm or .cfc file. (And even then, the main concern he was raising was that then such code might be able to do things that the CF Sandbox feature would have otherwise prevented executing at runtime. His observation was that such compiled bytecode in a cfc or cfm file circumvents that sandbox protection, if enabled.)
Anyway, the main point of contention I'm making here (regarding your suggesiton that he search for and start decompiling .class files) is that it's just not necessary: there's no way that CF will execute a .class file. That's not a feature of CF. Again the protection of this recent change is merely to prevent running of cfm or cfc files which CONTAIN such bytecode.
And so yes, the challenge some might have is finding any such .cfc, .cfm, .cfml files (but NOT .class files) holding such bytecode, if they wonder whether the new default blocking of that would affect those. And that is indeed why I proposed searching for *.cf* files.
By @Charlie Arehart
I can now see a point you're making, @Charlie Arehart . But it's not the whole story. A clarification is in order.
The Java bytecode that this thread is about represents a *.class file - even when the bytecode is stored as a *.cfm or *.cfc file. For example, if you use cfcompile without the -deploy flag, you will get a *.cfm or *.cfc file (the ones you're referring to). However, with the -deploy flag, the bytecode is stored as a *.class file.
I had assumed that @Dordrecht asked for a way to differentiate any such previously precompiled class files from the classes that ColdFusion currently generates as a result of the setting "Save class files".
Copy link to clipboard
Copied
One more time: any such .class files are NOT the concern of this change preventing the execution of cfml pages comprised of byte code.
Have you yet read Brian Reilly's post I linked to? It's incredibly informative and compelling. I think it would help you better appreciate what this is all about.
Copy link to clipboard
Copied
Charlie, I have been experimenting a lot with the generation of Java bytecode in ColdFusion - to *.class files as well as to *cfm and *.cfc files. I have also been engaged in a study investigating the ways in which malicious attackers could use them to undermine a server. However, thanks for the reference. I will check it out. There are always things to learn from others.
To respond to your remark, I did not say that such *.class files are the concern of the change preventing the execution of cfml pages comprising Java bytecode. This point is crucial. So I shall clarify once again.
ColdFusion has the very unsafe tradition of being able to directly run Java bytecode (essentially class files) that are stored with *cfm, .*.cfc or *.cfr extension. Such files result from applying cfcompile without the -deploy flag. The new change prevents ColdFusion from running such files directly. You have comprehensively discussed that point, as I acknowledged.
That was the first case. There is a second case: the Java bytecode that results from applying cfcompile with the -deploy flag. The result is the same Java bytecode as before, but now stored as *.class files. Provided these were on the classpath, ColdFusion would gladly execute them. The new JVM flag would not prevent that.
To repeat, I had assumed that @Dordrecht asked for a way to distinguish between any such previously precompiled class files and the classes that ColdFusion currently generates as a result of the setting "Save class files".
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more