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.
Yes, the flag -Dcoldfusion.compiler.block.bytecode=true prevents ColdFusion from executing pre-compiled CFML code (Java bytecode) at runtime.
Yes, ColdFusion works by executing precompiled Java bytecode at runtime.
Yes, with "Save class files" turned on in the Administrator, ColdFusion will be able to run the precompiled class files that it caches (normally in \WEB-INF\cfclasses). In other words, ColdFusion is able to run its own precompiled Java bytecode in spite of the JVM flag being switched on. So, what's up?
There is no contradiction. The first statement should actually have read,
"Yes, the flag -Dcoldfusion.compiler.block.bytecode=true prevents ColdFusion from executing any pre-compiled CFML code (Java bytecode) at runtime from an untrusted or unauthorized path".
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:
Create a directory called MyAppJavaBytecode. Create within it 2 subdirectories, classes and jars.
Search the application for *.class files and *.jar files. (From the foregoing, the search excludes the \WEB-INF\cfclasses\ directory and directories such as \cfusion\lib\ which are authorized to be in the classpath.) Also remember: the search is for *.class files and *.jar files that represent CFM pages or CFCs. So, there is no need to include CurrentCustomerYearAccounts2025.class if it's known for sure that it represents the class for CurrentCustomerYearAccounts2025.java. For the same reason, there is no need to include CurrentCustomerYearAccounts.jar or ColdFusion's Jar files.
If the search locates a *.class file, and the file is suspected to represent a CFM or CFC file, then the file is copied to MyAppJavaBytecode/classes. If the search locates a *.jar file, and the file is suspected to represent CFM or CFC files, then the file is copied to MyAppJavaBytecode/jars.
Assuming some *.class files have been found, create a ZIP of the folder MyAppJavaBytecode/classes.
Use a Java Decompiler to decompile the ZIP as one batch, and any suspect Jar files found. .
Such decompilers usually have a search function. Use it to search for the strings "import coldfusion.runtime.CFPage", "import coldfusion.runtime.CfJspPage" and "import coldfusion.runtime.CFComponent". The first two suggest the bytecode of a CFM page; the last two suggest that of a CFC.
... View more