GHSA-wpr2-j6gr-pjw9: Github.com/opentofu/opentofu OpenTofu Potential Leaking Of Secret Vulnerability

LOW
CVSS 3.7
CWE-200
Published
Advisory Summary

GHSA-wpr2-j6gr-pjw9 is a LOW (CVSS 3.7) opentofu potential leaking of secret vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Github.com/opentofu/opentofu libraries in the Go ecosystem. The issue involves opentofu potential leaking of secret variable values when using static evaluation in v1.8. Remediation is available by upgrading affected packages to version 1.8.3.

GHSA-wpr2-j6gr-pjw9 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-wpr2-j6gr-pjw9
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product Github.com/opentofu/opentofu
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 3.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix GHSA-wpr2-j6gr-pjw9

To remediate this vulnerability, upgrade all affected Github.com/opentofu/opentofu dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/opentofu/opentofu fixed: 1.8.3
Upgrade github.com/opentofu/opentofu to 1.8.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/opentofu/opentofu

How to Check if You Are Affected

To determine whether your application is affected by GHSA-wpr2-j6gr-pjw9, inspect your project dependencies for Github.com/opentofu/opentofu:

inspect dependencies for github.com/opentofu/opentofu

Analyze the terminal output to locate any version of Github.com/opentofu/opentofu in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.8.3), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In Github.com/opentofu/opentofu, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Users who have opted into static evaluation of module sources, versions, and backend configurations may be at risk of exposing sensitive variables and locals. This is a workflow that should not be possible and explicitly show errors. ### Workarounds Check that you are not using sensitive variables in module sources and versions, as well as backend configurations. The patch will add explicit errors and prevent this from being possible. ### Examples ```hcl variable "backend_path" { type = string sensitive = true } terraform { backend "local" { path = var.backend_path } } ``` ```hcl variable "mod_info" { type = string sensitive = true } module "foo" { source = var.mod_info //version = var.mod_info } ```

GHSA-wpr2-j6gr-pjw9 Affected Github.com/opentofu/opentofu Versions

1 component(s)
Fixed Versions:
1.8.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/opentofu/opentofu
Go
≥ 1.8.0
< 1.8.3
1.8.3

References

Frequently Asked Questions

What is GHSA-wpr2-j6gr-pjw9?
GHSA-wpr2-j6gr-pjw9 is a security vulnerability in Github.com/opentofu/opentofu involving OpenTofu potential leaking of secret variable values when using static evaluation in v1.8 under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which Github.com/opentofu/opentofu versions are affected?
Affected versions include releases prior to 1.8.3 across affected packages: github.com/opentofu/opentofu.
What version fixes GHSA-wpr2-j6gr-pjw9?
Upgrading to 1.8.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/opentofu/opentofu affected?
Yes, github.com/opentofu/opentofu is affected in releases prior to 1.8.3. Upgrade your dependency to 1.8.3 or later.
What is the CVSS score of GHSA-wpr2-j6gr-pjw9?
GHSA-wpr2-j6gr-pjw9 has a CVSS v3.1 base score of 3.7 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with GHSA-wpr2-j6gr-pjw9?
GHSA-wpr2-j6gr-pjw9 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check Go dependencies for GHSA-wpr2-j6gr-pjw9?
Run the dependency tree command: 'inspect dependencies for github.com/opentofu/opentofu'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-wpr2-j6gr-pjw9",
  "modified" : "2024-10-09T22:51:43Z",
  "published" : "2024-10-03T16:51:50Z",
  "aliases" : [ ],
  "summary" : "OpenTofu potential leaking of secret variable values when using static evaluation in v1.8",
  "details" : "### Impact\nUsers who have opted into static evaluation of module sources, versions, and backend configurations may be at risk of exposing sensitive variables and locals.  This is a workflow that should not be possible and explicitly show errors.\n\n### Workarounds\nCheck that you are not using sensitive variables in module sources and versions, as well as backend configurations.  The patch will add explicit errors and prevent this from being possible.\n\n### Examples\n```hcl\nvariable \"backend_path\" {\n        type = string\n        sensitive = true\n}\n\nterraform {\n        backend \"local\" {\n                path = var.backend_path\n        }\n}\n```\n\n```hcl\nvariable \"mod_info\" {\n        type = string\n        sensitive = true\n}\n\nmodule \"foo\" {\n        source = var.mod_info\n        //version = var.mod_info\n}\n```\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/opentofu/opentofu"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.8.0"
      }, {
        "fixed" : "1.8.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/opentofu/opentofu/security/advisories/GHSA-wpr2-j6gr-pjw9"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/opentofu/opentofu"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2024-3182"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-10-03T16:51:50Z",
    "nvd_published_at" : null
  }
}