CVE-2026-14361

Consul-template is vulnerable to path redirection in writeToFile through symlink attack

Published Jul 8, 2026 CVSS 3.1 · 4.7 Medium EPSS < 1% KEV · Not listed
Description
The consul-template library before version 0.42.1 is vulnerable to a path redirection issue in the writeToFile template helper that may allow template output to be written outside the intended directory or to overwrite an existing file. This vulnerability (CVE-2026-14361) is fixed in consul-template 0.42.1.

Analysis

AI-generated

Technical impact

The consul‑template library contains a path‑redirection flaw in the writeToFile template helper. An attacker who supplies a crafted template can cause the rendered output to be written to a location outside the intended directory or to overwrite an existing file. This flaw allows unintended file creation or modification and could compromise configuration files, logs, or other sensitive data. The weakness is classified as CWE‑59 and has a CVSS score of 4.7, indicating a moderate severity impact on confidentiality and integrity.

Affected Systems

All installations of HashiCorp consul‑template prior to version 0.42.1 are affected. The vulnerability is triggered when the writeToFile helper is used to persist template output to disk; applications that render templates to the filesystem must ensure that the target file path is not controlled by an attacker or does not contain symlinks. The fixed version is 0.42.1, which eliminates the path‑redirection behavior.

Risk and Exploitability

The CVSS score of 4.7 reflects moderate risk, while the EPSS score of less than 1% indicates a very low likelihood of exploitation, and the vulnerability is not in the CISA KEV catalog. Exploitation can be achieved by supplying a malicious template that references an absolute path or a symlink, and it requires the consul‑template process to run with sufficient privileges to write to the target location. Based on the description, it is inferred that the attack vector is the untrusted template input; mitigating privilege and input validation reduces the risk.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade consul‑template to version 0.42.1 or later to eliminate the path‑redirection flaw.
  • If an upgrade is not immediately possible, ensure that any template that uses the writeToFile helper originates from a trusted source or remove the helper from untrusted templates.
  • Run the consul‑template process under a least‑privilege user account and configure file system permissions so that the user cannot write beyond a designated safe output path, preventing unintended file writes.

Generated by OpenCVE AI on August 1, 2026 at 15:39 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Hashicorp
Hashicorp tooling
Vendors & Products Hashicorp
Hashicorp tooling
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description The consul-template library before version 0.42.1 is vulnerable to a path redirection issue in the writeToFile template helper that may allow template output to be written outside the intended directory or to overwrite an existing file. This vulnerability (CVE-2026-14361) is fixed in consul-template 0.42.1.
Title Consul-template is vulnerable to path redirection in writeToFile through symlink attack
Weaknesses CWE-59
References
Metrics cvssV3_1

{'score': 4.7, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N'}

Weaknesses
  • CWE-59

    Improper Link Resolution Before File Access ('Link Following')

Sources

Status
PUBLISHED
Assigner
HashiCorp
Published
Updated
Jul 8, 2026, 8:37 PM
Reserved
Jul 1, 2026, 7:00 PM
Status
Deferred
Published
Jul 8, 2026, 8:16 PM
Modified
Oct 25, 2026, 5:10 PM