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

Summary

21/08/2024
Yes i
Moderate
6.3

CVE-2023-4782: Terraform allows arbitrary file write during the init operation in github.com/hashicorp/terraform. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Terraform is an open-source infrastructure as code software tool developed by HashiCorp. It allows users to define and provision infrastructure resources in a declarative configuration language. Terraform is widely used for managing cloud infrastructure and has a large ecosystem of providers and modules. However, a vulnerability has been discovered in Terraform that allows arbitrary file write during the init operation.

Vulnerability Detail

The vulnerability in Terraform allows an attacker to write arbitrary files during the init operation. This can lead to unauthorized modifications to the infrastructure configuration or the execution of malicious code. The vulnerability exists in versions 1.0.8 and earlier of the github.com/hashicorp/terraform package. It has been fixed in version 1.5.7.

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 update to the fixed version as soon as possible.

Conclusion

The arbitrary file write vulnerability in Terraform can have serious consequences, allowing attackers to modify infrastructure configurations or execute malicious code. Users should update to version 1.5.7 or later to mitigate this vulnerability.

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

Share this vulnerability

FAQ

Terraform is an open-source infrastructure as code software tool developed by HashiCorp. It allows users to define and provision infrastructure resources in a declarative configuration language.

The vulnerability allows an attacker to write arbitrary files during the init operation in Terraform. This can lead to unauthorized modifications to the infrastructure configuration or the execution of malicious code.

Versions 1.0.8 and earlier of the github.com/hashicorp/terraform package are affected by this vulnerability.

To fix the 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 fixed version.

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