CVE-2023-4782: Arbitrary File Write Vulnerability in Terraform

Summary

08/09/2023
Yes i
Moderate
6.3

CVE-2023-4782: Terraform allows arbitrary file write during the init operation. Affects github.com/hashicorp/terraform versions >= 1.0.8, < 1.5.7. Fixed in 1.5.7. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Terraform is an open-source infrastructure as code software tool created by HashiCorp. It allows users to define and provision infrastructure resources in a declarative manner. Terraform is widely used for managing cloud infrastructure and is written in the Go programming language. This vulnerability affects Terraform versions 1.0.8 through 1.5.6.

Vulnerability Detail

The vulnerability in Terraform allows for arbitrary file write during the init operation when executed on a maliciously crafted Terraform configuration. An attacker can exploit this vulnerability to write arbitrary files on the system, potentially leading to unauthorized access, data leakage, or further compromise of the infrastructure. The vulnerability has a CVSS score of 6.3, indicating a moderate severity level.

How To Fix

Latest published version: v1.17.0 as of 22 Oct 2026

go get github.com/hashicorp/terraform@v1.17.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.5.7

This is the first release that contains the fix.

go get github.com/hashicorp/terraform@v1.5.7

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is recommended to apply the fix by updating to the latest version of Terraform.

Conclusion

The arbitrary file write vulnerability in Terraform can be mitigated by updating to version 1.5.7 or later. It is crucial to promptly apply this fix to prevent potential unauthorized access or compromise of infrastructure resources. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for github.com/hashicorp/terraform →

Share this vulnerability

FAQ

Terraform is an open-source infrastructure as code software tool used for provisioning and managing cloud infrastructure resources.

The vulnerability allows an attacker to write arbitrary files during the init operation, potentially leading to unauthorized access, data leakage, or further compromise of the infrastructure.

Terraform versions 1.0.8 through 1.5.6 are affected by this vulnerability.

To fix this vulnerability, update your Terraform installation to version 1.5.7 or later.

There is no known workaround for this vulnerability. It is recommended to update to the latest version of Terraform.

Related vulnerabilities

Recent vulnerabilities recorded for github.com/hashicorp/terraform.

How To Fix

Latest published version: v1.17.0 as of 22 Oct 2026

go get github.com/hashicorp/terraform@v1.17.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.5.7

This is the first release that contains the fix.

go get github.com/hashicorp/terraform@v1.5.7

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback