Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2023-4782

CVE-2023-4782: Hashicorp Terraform Path Traversal Flaw

CVE-2023-4782 is a path traversal vulnerability in Hashicorp Terraform that enables arbitrary file write during init operations with malicious configurations. This article covers technical details, affected versions, and mitigation.

Published: February 4, 2026

CVE-2023-4782 Overview

CVE-2023-4782 is a Path Traversal vulnerability affecting HashiCorp Terraform versions 1.0.8 through 1.5.6. The vulnerability allows arbitrary file write during the init operation when run on maliciously crafted Terraform configuration files. This flaw stems from improper input validation (CWE-22) that enables attackers to write files to arbitrary locations on the filesystem, potentially leading to code execution, privilege escalation, or system compromise.

Critical Impact

Attackers can leverage malicious Terraform configurations to write arbitrary files to the target system during initialization, potentially overwriting critical system files or planting malicious executables.

Affected Products

  • HashiCorp Terraform versions 1.0.8 through 1.5.6
  • Any system running affected Terraform versions with untrusted configuration sources
  • CI/CD pipelines and automation systems executing terraform init on external configurations

Discovery Timeline

  • 2023-09-08 - CVE-2023-4782 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2023-4782

Vulnerability Analysis

This vulnerability exists in Terraform's initialization process, specifically during the terraform init command execution. The flaw allows an attacker to craft malicious Terraform configuration files that, when processed by the init operation, can write files to arbitrary locations outside the intended working directory.

The vulnerability is classified under CWE-22 (Improper Limitation of a Pathname to a Restricted Directory), commonly known as Path Traversal. This class of vulnerabilities occurs when software uses external input to construct a pathname without properly neutralizing special elements that could cause the pathname to resolve to an unintended location.

The attack requires local access and user interaction in the form of running terraform init on a malicious configuration. However, in automated CI/CD environments where Terraform configurations may be pulled from external sources, this vulnerability poses a significant risk as the initialization process is often automated without manual review.

Root Cause

The root cause lies in insufficient path validation during Terraform's initialization phase. When processing configuration files, Terraform fails to properly sanitize file paths, allowing directory traversal sequences (such as ../) or absolute paths to be interpreted literally. This enables malicious configurations to specify write targets outside the Terraform working directory.

Attack Vector

The attack vector for CVE-2023-4782 requires local access to execute. An attacker must craft a malicious Terraform configuration and convince a victim to run terraform init on it, or inject the malicious configuration into a repository that feeds into an automated Terraform pipeline.

The exploitation scenario typically involves:

  1. Attacker creates or modifies Terraform configuration with malicious file write directives
  2. Victim obtains and runs terraform init on the configuration (directly or via automation)
  3. Terraform writes files to arbitrary filesystem locations during initialization
  4. Attacker achieves code execution, persistence, or data manipulation depending on targeted files

Since no verified code examples are available, the vulnerability mechanism involves maliciously crafted Terraform module configurations that exploit path traversal weaknesses during the provider or module download and extraction phases of the init command. For detailed technical analysis, refer to the HashiCorp Security Advisory.

Detection Methods for CVE-2023-4782

Indicators of Compromise

  • Unexpected files appearing in system directories after running terraform init
  • Terraform configuration files containing unusual path references with ../ sequences
  • Modified system binaries, cron jobs, or startup scripts coinciding with Terraform operations
  • Unexpected file modifications in directories outside the Terraform working directory

Detection Strategies

  • Audit Terraform configurations before execution, especially from untrusted sources
  • Monitor filesystem write operations during terraform init execution for writes outside the working directory
  • Implement file integrity monitoring (FIM) on critical system directories
  • Review CI/CD pipeline logs for anomalous Terraform behavior or unexpected file operations

Monitoring Recommendations

  • Deploy endpoint detection and response (EDR) solutions to monitor Terraform process behavior
  • Configure alerts for file writes by Terraform processes to sensitive system paths
  • Implement sandboxing or containerization for Terraform operations to limit filesystem access
  • Enable verbose logging for Terraform operations in automated pipelines

How to Mitigate CVE-2023-4782

Immediate Actions Required

  • Upgrade HashiCorp Terraform to version 1.5.7 or later immediately
  • Audit all existing Terraform configurations for potentially malicious content
  • Review CI/CD pipelines to ensure Terraform configurations come from trusted sources only
  • Consider running Terraform operations in isolated environments with restricted filesystem access

Patch Information

HashiCorp has addressed this vulnerability in Terraform version 1.5.7. Organizations should upgrade all Terraform installations to this version or later. The fix implements proper path validation during the initialization process to prevent directory traversal attacks.

For detailed patch information and upgrade instructions, see the HashiCorp Security Advisory (HCSEC-2023-27).

Workarounds

  • Run Terraform in containerized or sandboxed environments with minimal filesystem permissions
  • Implement strict code review processes for all Terraform configuration changes
  • Use policy-as-code tools to validate Terraform configurations before execution
  • Restrict network access during Terraform initialization to prevent fetching malicious remote modules
bash
# Example: Run Terraform in a container with restricted filesystem access
docker run --rm -v $(pwd):/workspace:ro \
  -v /path/to/safe/output:/workspace/.terraform \
  --read-only \
  hashicorp/terraform:1.5.7 init

# Verify Terraform version is patched
terraform version
# Should show: Terraform v1.5.7 or higher

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypePath Traversal

  • Vendor/TechHashicorp Terraform

  • SeverityHIGH

  • CVSS Score7.8

  • EPSS Probability0.04%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-22
  • Vendor Resources
  • HashiCorp Security Advisory
  • Latest CVEs
  • CVE-2025-52793: Esselink.nu Settings CSRF Vulnerability

  • CVE-2025-52772: Virtual Moderator CSRF Vulnerability

  • CVE-2025-48279: WC MyParcel Belgium XSS Vulnerability

  • CVE-2025-39381: KiotViet Sync CSRF Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English