Skip to content

CVE-2026-84939 GHSA-27j2-h3m2-8237 freemarker: Path traversal in template loading via malformed locale in doc-maven-plugin (2.3.22 -> 2.3.35) - #311

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

vharseko merged 1 commit into
masterfrom
dependabot/maven/commons/doc-maven-plugin/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.22 to 2.3.35 in commons/doc-maven-plugin/pom.xml, clearing Dependabot alert #111.

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 commons

None at runtime, low in the build. FreeMarker is a dependency of doc-maven-plugin only, a Maven plugin that runs while documentation is built; it is not a dependency of any library artifact. The plugin uses it in two places — pre/ArtifactBuilder (artifact.ftl) and utils/OLinkUtils (olinkdb.ftl). Both create a Configuration with setClassForTemplateLoading(..., "/templates") and load a fixed template name with configuration.getTemplate(name), i.e. with the JVM default locale. No external input chooses the locale, so the malformed locale the advisory requires cannot reach FreeMarker, and the class-path loader could only reach class-path resources anyway. The bump takes the plugin out of the vulnerable range.

Change

org.freemarker:freemarker 2.3.22 → 2.3.35 in commons/doc-maven-plugin/pom.xml. Both call sites construct Configuration with Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS (2.3.0), so the template-processing behaviour stays at the 2.3.0 compatibility level across the upgrade. No code change.

References

Bumps org.freemarker:freemarker from 2.3.22 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.22 to 2.3.35 in /commons/doc-maven-plugin CVE-2026-84939 GHSA-27j2-h3m2-8237 freemarker: Path traversal in template loading via malformed locale in doc-maven-plugin (2.3.22 -> 2.3.35) Sep 25, 2026
@vharseko
vharseko merged commit b7f7c7e into master Sep 25, 2026
14 checks passed
@vharseko
vharseko deleted the dependabot/maven/commons/doc-maven-plugin/org.freemarker-freemarker-2.3.35 branch September 25, 2026 05:47
vharseko added a commit to OpenIdentityPlatform/OpenDJ that referenced this pull request Oct 6, 2026
…#1176)

Two code scanning alerts on `master`.

### Alert 1297: FreeMarker 2.3.34 → 2.3.35 (CVE-2026-84939)

FreeMarker before 2.3.35 resolves a malformed locale identifier into a
path outside the template root. Trivy reports it on
`opt/opendj/lib/org.freemarker.freemarker.jar` of the image built from
`master` (`trivy-build-alpine`).

In OpenDJ it is not reachable: FreeMarker only renders OpenDJ's own
templates, in `DocGenerationHelper` (opendj-cli) and the doc maven
plugin, and nothing takes a locale from a client. The jar ships in
`lib/` all the same, so the alert stays open until the version moves.
commons made the same bump in OpenIdentityPlatform/commons#311.

All three `Configuration` instances are built with
`Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS`, a fixed constant, so
the template behaviour does not follow the library version.

### Alert 1281: `CompressedSchema.loadObjectClassesToMaps` javadoc

The javadoc listed a `sync` parameter the method does not have (left
over from #920) and documented `mappings` twice, with the encode and
decode maps the wrong way round.

### Not in this PR

- jackson 2.18.9 → 2.18.11 (alerts 1302, 1305–1308) and netty-handler
4.2.15 → 4.2.17+ (alert 1284) come from the commons parent
(`jackson.version`, `netty-bom`), so they belong in a commons change and
a `commons.version` bump.
- The `trivy-image-*` alerts are on the published 5.1.2 image; `master`
already carries the fixed versions (bc-fips 2.1.3, jackson 2.18.9,
postgresql 42.7.12, mssql-jdbc 13.4.0, a fresh base image). They close
with the next release.

### Testing

`mvn -pl opendj-cli,opendj-doc-maven-plugin -am package -DskipTests`
builds with 2.3.35. The documentation generation itself runs in CI.
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant