Release date: 2026-08-23 + release process
Changes on the FTL side
-
Added support for hexadecimal literals, like
0xFF, or0xCAFEBABE. See more here... -
New multi-line text built-ins, mostly useful for source code (or configuration file) generation:
Changes on the Java side
-
Added GraalVM native (AOT) support. But it doesn't "just work", as you have to explicitly configure reflection and resource access for your application; see more here!
-
FREEMARKER-234:
BeansWrapper, and thereforeDefaultObjectWrapper, now exposesisFoo()methods that returnjava.lang.Boolean(the wrapper class) as thefoobean property, if you set theincompatible_improvementssetting to 2.3.35 or higher. Earlier this only worked if the return type was primitiveboolean, consistently with the JavaBeans specification. -
ClassTemplateLoaderandWebappTemplateLoadernow checks against backing out from the base directory (and throwsMalformedTemplateNameExceptionif that happens), instead of only relying onTemplateCachefor that. (Note thatFileTemplateLoaderalways did this check.) In principle, this is the responsibility ofTemplateCache, however, not everyone getsTemplate-s throughConfiguration.getTemplate, and so throughTemplateCache. While theTemplateLoadercontract doesn't promise any such checks, it's relatively cheap to do in this case, and adds an extra layer of security. -
Removed
freemarker.debugpackage entirely, because of its dependency on RMI, which often caused security scan alerts (even though it wasn't active by default). This was an old effort to support remote debugging of templates, and probably wasn't used by anyone anymore. -
Fixed issue with in XML DOM imperative XML processing, where the
@@markupand@@nested_markupkeys did not XML-escape the values of thexmlnsorxmlnx:prefixattributes. These are URL-s, that could for example contain&character, and the output XML was broken earlier. -
In
freemarker.ext.dom.NodeModelused for XML DOM wrapping, marked static utility methods as@Deprecated, as by default they use aDocumentBuilderFactorythat resolved external entities, which opens the possibility of XXE attacks. While this was documented, it was easy to miss, and now the deprecation marking draws attention to it. -
Improved
DefaultMemberAccessPolicy-rules(used by default) to block listing Java system properties. Note that no matter how much we tweak this, it will never provide proper security if you have untrusted template authors! See this in the FAQ! -
Deleted some long deprecated
mainmethods (CLI entry points), and usually the entire class they were in. These are often flagged as security issues, while they were hardly ever used:-
freemarker.core.CommandLineclass. This was theMain-Classoffreemarker.jar, and it just printed the version number. -
freemarker.ext.dom.Transformclass: Was a very minimalist utility to run a template with an XML document as the model -
freemarker.ext.jdom.NodeListModel.mainmethod: The even older minimalist utility to run a template with an XML document as the model. (Thefreemarker.ext.jdompackage itself is also long deprecated.) -
freemarker.template.utility.ToCanonicalclass: This has outputted the specified template files in canonical format
-
