Skip to content

CVE-2026-84939 GHSA-27j2-h3m2-8237 freemarker: Path traversal in template loading via malformed locale (2.3.31 -> 2.3.35) - #1142

Merged
vharseko merged 1 commit into
masterfrom
dependabot/maven/org.freemarker-freemarker-2.3.35
Sep 25, 2026
Merged

vharseko merged 1 commit into
masterfrom
dependabot/maven/org.freemarker-freemarker-2.3.35

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Bumps org.freemarker:freemarker from 2.3.31 to 2.3.35 (freemarker.version in the root pom.xml), clearing Dependabot alert #324.

Advisory

CVE-2026-84939 / GHSA-27j2-h3m2-8237 — Path traversal (CWE-23) in the FreeMarker template loading mechanism. If an attacker can pass an arbitrary malformed locale identifier to FreeMarker and localized lookup is enabled (the default), the localized template name built from that locale can escape the intended template path. What can be read is still bounded by the configured TemplateLoader: FileTemplateLoader stays inside its baseDir, a class-loader based loader can reach only what the class loader can load, a servlet-context loader only what the web application context exposes. 2.3.35 fixes the lookup (apache/freemarker@83953d9); disabling localized lookup mitigates older versions.

Severity Critical — CVSS 3.1 9.1 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N)
Affected org.freemarker:freemarker >= 2.2.0, <= 2.3.34
Fixed in 2.3.35

Impact on OpenAM

Low. FreeMarker ships in the WAR (openam-server-only) and is used by the OAuth2 provider to render its HTML pages (authorization consent, device code verification, form_post response) through org.forgerock.oauth2.restlet.TemplateFactory. That factory builds a single Configuration with a MultiTemplateLoader over Restlet's ContextTemplateLoader("clap:///") and a ClassTemplateLoader, and loads templates with config.getTemplate(name) — i.e. with the configuration's default locale (the JVM default). No request-controlled locale reaches FreeMarker, so the attacker-supplied locale the advisory requires is not available, and both loaders are confined to class-path resources anyway. The Click FreemarkerTemplateService is referenced only in Javadoc. The bump takes the shipped library out of the vulnerable range.

Change

freemarker.version: 2.3.31 → 2.3.35 in the root pom.xml. org.restlet.ext.freemarker already excludes its own FreeMarker, so the managed version is the one that ends up in the WAR. No code or behaviour change.

References

Bumps org.freemarker:freemarker from 2.3.31 to 2.3.35.

---
updated-dependencies:
- dependency-name: org.freemarker:freemarker
  dependency-version: 2.3.35
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file java Pull requests that update java code labels Sep 24, 2026
@vharseko vharseko changed the title Bump org.freemarker:freemarker from 2.3.31 to 2.3.35 CVE-2026-84939 GHSA-27j2-h3m2-8237 freemarker: Path traversal in template loading via malformed locale (2.3.31 -> 2.3.35) Sep 25, 2026
@vharseko vharseko added the security Security fix or hardening (CVE, GHSA, XSS/CSRF/SSRF) label Sep 25, 2026
@vharseko
vharseko merged commit e4b28e9 into master Sep 25, 2026
15 checks passed
@vharseko
vharseko deleted the dependabot/maven/org.freemarker-freemarker-2.3.35 branch September 25, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file java Pull requests that update java code security Security fix or hardening (CVE, GHSA, XSS/CSRF/SSRF)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant