CVE-2026-84939: Freemarker Path Traversal Vulnerability

CRITICAL
Advisory Identifier: GHSA-27j2-h3m2-8237
CVSS 9.1
CWE-23
Published
Advisory Summary

CVE-2026-84939 is a CRITICAL (CVSS 9.1) path traversal vulnerability (CWE-23: Relative Path Traversal) affecting Freemarker libraries in the Maven ecosystem. The issue involves apache freemarker template loading mechanism vulnerable to path traversal. Remediation is available by upgrading affected packages to version 2.3.35.

CVE-2026-84939 at a Glance

CVE Identifier CVE-2026-84939
GHSA Identifier GHSA-27j2-h3m2-8237
Severity CRITICAL
CVSS v3.1 Base Score 9.1
CWE Classification CWE-23: Relative Path Traversal
Affected Product Freemarker
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 9.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-84939

To remediate this vulnerability, upgrade all affected Freemarker dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.freemarker:freemarker fixed: 2.3.35
<dependency>
    <groupId>org.freemarker</groupId>
    <artifactId>freemarker</artifactId>
    <version>2.3.35</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.freemarker

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2026-84939, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.freemarker

Analyze the terminal output to locate any version of Freemarker in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.3.35), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.freemarker command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-23: Relative Path Traversal, where the product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory. In Freemarker, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Path traversal vulnerability in Apache FreeMarker template loading mechanism, if the attacker can specify an arbitrary malformed locale identifier to FreeMarker, and the localized lookup configuration setting is enabled (it's by default enabled). This issue affects Apache FreeMarker from 2.2.0 through 2.3.34. Users are recommended to upgrade to version 2.3.35. Disabling localized lookup in previous versions also mitigates this. Note that even in versions affected by this vulnerability, the files that can be loaded remain restricted by the TemplateLoader that FreeMarker is configured to use. In particular, FileTemplateLoader prevents attempts to traverse outside the baseDir specified in its constructor. Other TemplateLoader implementations may allow access outside their designated base directory, but they are still constrained by the underlying storage mechanism—for example, a loader wrapping a Java class loader can only access resources that the class loader can load, while one wrapping a web application context can only access resources available through that context.

CVE-2026-84939 Affected Freemarker Versions

1 component(s)
Fixed Versions:
2.3.35
Product / Package Ecosystem Affected Versions Fixed Version
org.freemarker:freemarker
Maven
≥ 2.2.0
< 2.3.35
2.3.35

References

Frequently Asked Questions

What is CVE-2026-84939?
CVE-2026-84939 is a security vulnerability in Freemarker involving Apache FreeMarker template loading mechanism vulnerable to path traversal under CWE-23: Relative Path Traversal.
Which Freemarker versions are affected?
Affected versions include releases prior to 2.3.35 across affected packages: org.freemarker:freemarker.
What version fixes CVE-2026-84939?
Upgrading to 2.3.35 (or the latest patched release for your respective branch) resolves the vulnerability.
Is freemarker affected?
Yes, org.freemarker:freemarker is affected in releases prior to 2.3.35. Upgrade your dependency to 2.3.35 or later.
What is the CVSS score of CVE-2026-84939?
CVE-2026-84939 has a CVSS v3.1 base score of 9.1 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2026-84939?
CVE-2026-84939 is classified under CWE-23: Relative Path Traversal (The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory.).
How can I check Maven dependencies for CVE-2026-84939?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.freemarker'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-27j2-h3m2-8237",
  "modified" : "2026-09-24T19:08:23Z",
  "published" : "2026-09-10T06:31:45Z",
  "aliases" : [ "CVE-2026-84939" ],
  "summary" : "Apache FreeMarker template loading mechanism vulnerable to path traversal",
  "details" : "Path traversal vulnerability in Apache FreeMarker template loading mechanism, if the attacker can specify an arbitrary malformed locale identifier to FreeMarker, and the localized lookup configuration setting is enabled (it's by default enabled).\n\nThis issue affects Apache FreeMarker from 2.2.0 through 2.3.34.\n\nUsers are recommended to upgrade to version 2.3.35. Disabling localized lookup in previous versions also mitigates this.\n\nNote that even in versions affected by this vulnerability, the files that can be loaded remain restricted by the TemplateLoader that FreeMarker is configured to use. In particular, FileTemplateLoader prevents attempts to traverse outside the baseDir specified in its constructor. Other TemplateLoader implementations may allow access outside their designated base directory, but they are still constrained by the underlying storage mechanism—for example, a loader wrapping a Java class loader can only access resources that the class loader can load, while one wrapping a web application context can only access resources available through that context.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.freemarker:freemarker"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.2.0"
      }, {
        "fixed" : "2.3.35"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.3.34"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-84939"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/freemarker/commit/83953d9a9fa5a7c1fce3e39ff57182c19a34b5eb"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/freemarker"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/freemarker/releases/tag/v2.3.35"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread/hrd7o2ylwkkswdyhyzllgqt0f80kyd5y"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2026/09/08/2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-23" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-24T19:08:23Z",
    "nvd_published_at" : "2026-09-10T06:17:06Z"
  }
}