{"answers":{"affected":"3 open source packages ship an affected version, including github.com/hashicorp/terraform. It affects 1 product.","exploited":"There is no known exploitation of CVE-2023-4782 in the wild and no public exploit code.","fix":"Upgrade github.com/hashicorp/terraform to 1.5.7 or later.","what":"CVE-2023-4782 is a medium-severity path traversal vulnerability in HashiCorp Terraform, published on 8 Sep 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2023-4782 and fix it if it is affected.\n\nWhat it is: CVE-2023-4782 is a medium-severity path traversal vulnerability in HashiCorp Terraform, published on 8 Sep 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2023-4782 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- github.com/hashicorp/terraform (Go): affected from 1.0.8; fixed in 1.5.7\n- github.com/hashicorp/terraform (Go): affected from 1.0.8; fixed in 1.5.7\n- github.com/hashicorp/terraform (Go): affected from 1.0.8; fixed in 1.5.7\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2023-4782/ (Markdown: https://insights.sbomify.com/CVE-2023-4782/index.md)","id":"CVE-2023-4782","markdown":"https://insights.sbomify.com/CVE-2023-4782/index.md","name":"CVE-2023-4782","record":{"aliases":["AZL-29705","GHSA-h626-pv66-hhm7","GO-2023-2055"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["code_execution","data_modify"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Terraform CLI","requires_auth":"high_privilege","summary":"Attackers can write arbitrary files during Terraform init via malicious configs, potentially leading to code execution or data modification.","user_interaction":"required","vuln_class":"path_traversal"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"HashiCorp","cpe":[{"product":"terraform","vendor":"hashicorp"}],"cvss":{"score":6.3,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:C/C:L/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"description":"Terraform version 1.0.8 through 1.5.6 allows arbitrary file write during the `init` operation if run on maliciously crafted Terraform configuration. This vulnerability is fixed in Terraform 1.5.7.","ecosystems":["Go"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Terraform Allows Arbitrary File Write During Init Operation","id":"CVE-2023-4782","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Go","product":null,"products":[],"type":"path_traversal","year":"2023"},"n_packages":3,"n_references":1,"next":{"headline":"Magee Shortcodes \u003c= 2.1.1 - Contributor+ Stored XSS via shortcode","id":"CVE-2023-4783"},"packages":[{"ecosystem":"Go","fixed":["1.5.7"],"introduced":["1.0.8"],"last_affected":[],"package":"github.com/hashicorp/terraform","purl":null,"source":"GHSA-h626-pv66-hhm7"},{"ecosystem":"Go","fixed":["1.5.7"],"introduced":["1.0.8"],"last_affected":[],"package":"github.com/hashicorp/terraform","purl":"pkg:golang/github.com/hashicorp/terraform","source":"GHSA-h626-pv66-hhm7"},{"ecosystem":"Go","fixed":["1.5.7"],"introduced":["1.0.8"],"last_affected":[],"package":"github.com/hashicorp/terraform","purl":"pkg:golang/github.com/hashicorp/terraform","source":"GO-2023-2055"}],"prev":{"headline":"Heap-based Buffer Overflow in vim/vim","id":"CVE-2023-4781"},"products":["Terraform"],"published":"2023-09-08","related":[{"cvss_score":9.8,"headline":"HashiCorp Terraform Amazon Web Services (AWS) uses an insecure PRNG","id":"CVE-2018-9057","kev_date_added":null,"published":"2018-03-27"},{"cvss_score":8.8,"headline":"Missing authorization in n/a","id":"CVE-2021-36230","kev_date_added":null,"published":"2021-07-20"},{"cvss_score":7.5,"headline":"Use of a Broken or Risky Cryptographic Algorithm in Terraform","id":"CVE-2019-19316","kev_date_added":null,"published":"2019-12-02"},{"cvss_score":4.3,"headline":"Terraform Enterprise state versions can be created by users with specific permissions without sufficient write access","id":"CVE-2025-13432","kev_date_added":null,"published":"2025-11-21"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"Go Vulnerability Database","prefix":"GO"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-09-26","vendors":["HashiCorp"]},"summary":"Attackers can write arbitrary files during Terraform init via malicious configs, potentially leading to code execution or data modification.","url":"https://insights.sbomify.com/CVE-2023-4782/"}