---
id: "CVE-2026-120316"
kind: "vulnerability"
aliases: ["CVE-2026-120316"]
title: "http4k: path traversal in Thymeleaf templates lets attackers read server files"
severity: "high"
cvss: 8.2
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["http4k", "java", "jvm", "kotlin", "package", "thymeleaf"]
not_affected_if: ["fixed-template-names", "no-thymeleaf"]
published_at: "2026-11-02T03:17:29+00:00"
first_seen_at: "2026-11-02T03:31:23+00:00"
updated_at: "2026-11-02T03:31:50+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-120316", "first_seen_at": "2026-11-02T03:31:23+00:00"}]
---

# http4k: path traversal in Thymeleaf templates lets attackers read server files

http4k's Thymeleaf template caching and hot-reload code does not contain template paths, so ../ segments in view template names escape the template directory. An unauthenticated attacker can read any file the server process can read.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the http4k version in the build file (for example `build.gradle` or `pom.xml`) and see whether it is below `6.62.0.0-ee`.
- Look for `ThymeleafTemplates` with Caching or HotReload enabled, and for views where `ViewModel.template()` takes values from request input.

## Fix

- http4k: move to `6.62.0.0-ee` or later.

## Timeline

- 2026-11-02T03:31:23+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-120316

## From the sources

http4k before 6.62.0.0-ee contains a path traversal vulnerability in ThymeleafTemplates Caching and HotReload that allows unauthenticated attackers to read files outside baseTemplateDir by supplying ../ segments in ViewModel.template() values. Attackers can influence request-driven template selection so Thymeleaf's FileTemplateResolver resolves escaped paths without containment checks, disclosing any file readable by the server process.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
