Skip to main content

consul-template CVE-2026-14361

| EUVDEUVD-2026-42346 MEDIUM
Improper Link Resolution Before File Access (CWE-59)
2026-07-08 security@hashicorp.com GHSA-xcm7-pmg9-8wjq
4.7
CVSS 3.1 · Vendor: hashicorp
Share

Severity by source

Vendor (hashicorp) PRIMARY
4.7 MEDIUM
AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N
vuln.today AI
5.3 MEDIUM

Local access and high complexity required for symlink race; I:L added because description explicitly states existing files can be overwritten, which the vendor's I:N underweights.

3.1 AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N
4.0 AV:L/AC:H/AT:P/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (hashicorp).

CVSS VectorVendor: hashicorp

Attack Vector
Local
Attack Complexity
High
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

Lifecycle Timeline

2
Patch available
Jul 08, 2026 - 21:04 EUVD
Analysis Generated
Jul 08, 2026 - 20:58 vuln.today

DescriptionCVE.org

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.

AnalysisAI

Path redirection via the writeToFile template helper in consul-template before 0.42.1 allows a local low-privileged attacker to redirect template output outside the intended destination directory or overwrite existing files on the filesystem. Because consul-template routinely renders sensitive secrets from HashiCorp Vault, Consul, and AWS Secrets Manager into local files, successful exploitation can expose those secrets by redirecting writes to attacker-readable locations. No public exploit code or CISA KEV listing is associated with this vulnerability at time of analysis.

Technical ContextAI

consul-template is a HashiCorp daemon that watches dynamic secret stores (Vault, Consul KV, AWS Secrets Manager) and renders Go templates to files on disk. The writeToFile template helper accepts a destination path and writes rendered template output to that path. CWE-59 (Improper Link Resolution Before File Access, 'Link Following') identifies the root cause: the library fails to canonicalize or validate the resolved destination path before performing the write, allowing a symlink or relative traversal sequence to redirect the write operation outside the intended directory boundary. The CVSS vector (AV:L/AC:H/PR:L) confirms the attack is local, requires low OS-level privileges, and involves high complexity - consistent with a race condition or a preconditioned symbolic link attack on the target path prior to consul-template's write operation. No CPE strings were provided in the input data; the affected software is the consul-template library developed and maintained by HashiCorp.

RemediationAI

Upgrade consul-template to version 0.42.1 or later, which contains the vendor-released fix for this vulnerability per HashiCorp advisory HCSEC-2026-20 (https://discuss.hashicorp.com/t/hcsec-2026-20-consul-template-vulnerable-to-path-redirections-in-writetofile/77559). If an immediate upgrade is not feasible, consider restricting the OS filesystem permissions of the directory into which consul-template writes, ensuring that no unprivileged local users can create symlinks or alter directory entries in that path - this disrupts the symlink-following attack precondition at the OS level. Additionally, enabling fs.protected_symlinks=1 on Linux (if not already set) prevents unprivileged processes from following symlinks in sticky world-writable directories, reducing the attack surface. Note that the path restriction workaround does not fully eliminate the risk if consul-template directories are shared or world-writable by design.

Share

CVE-2026-14361 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy