CVE-2023-34236: Github.com/weaveworks/tf controller Weave GitOps Terraform Controller Information Vulnerability

HIGH
Advisory Identifier: GHSA-6hvv-j432-23cv
CVSS 8.5
CWE-312 CWE-532 CWE-522 CWE-200
Published
Advisory Summary

CVE-2023-34236 is a HIGH (CVSS 8.5) weave gitops terraform controller information vulnerability (CWE-312: Cleartext Storage of Sensitive Information) affecting Github.com/weaveworks/tf controller libraries in the Go ecosystem. The issue involves weave gitops terraform controller information disclosure vulnerability. Remediation is available by upgrading affected packages to version 0.14.4, 0.15.0-rc.5.

CVE-2023-34236 at a Glance

CVE Identifier CVE-2023-34236
GHSA Identifier GHSA-6hvv-j432-23cv
Severity HIGH
CVSS v3.1 Base Score 8.5
CWE Classification CWE-312: Cleartext Storage of Sensitive Information
Affected Product Github.com/weaveworks/tf controller
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.5

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

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

How to Fix CVE-2023-34236

To remediate this vulnerability, upgrade all affected Github.com/weaveworks/tf controller 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/weaveworks/tf-controller fixed: 0.14.4
Upgrade github.com/weaveworks/tf-controller to 0.14.4
github.com/weaveworks/tf-controller fixed: 0.15.0-rc.5
Upgrade github.com/weaveworks/tf-controller to 0.15.0-rc.5
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/weaveworks/tf-controller

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-34236, inspect your project dependencies for Github.com/weaveworks/tf controller:

inspect dependencies for github.com/weaveworks/tf-controller

Analyze the terminal output to locate any version of Github.com/weaveworks/tf controller in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.14.4), 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-312: Cleartext Storage of Sensitive Information, where the product stores sensitive information in cleartext within a resource that might be accessible to another control sphere. In Github.com/weaveworks/tf controller, 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 A vulnerability has been identified in Weave GitOps Terraform Controller which could allow an authenticated remote attacker to view sensitive information. This vulnerability stems from Weave GitOps Terraform Runners (`tf-runner`), where sensitive data is inadvertently printed - potentially revealing sensitive user data in their pod logs. In particular, functions `tfexec.ShowPlan`, `tfexec.ShowPlanRaw`, and `tfexec.Output` are implicated when the `tfexec` object set its `Stdout` and `Stderr` to be `os.Stdout` and `os.Stderr`. An unauthorized remote attacker could exploit this vulnerability by accessing these prints of sensitive information, which may contain configurations or tokens that could be used to gain unauthorized control or access to resources managed by the Terraform controller. A successful exploit could allow the attacker to utilize this sensitive data, potentially leading to unauthorized access or control of the system. ### Patches This vulnerability has been addressed in Weave GitOps Terraform Controller versions `v0.14.4` and `v0.15.0-rc.5`. Users are urged to upgrade to one of these versions to mitigate the vulnerability. The patches for this vulnerability are found in: - this commit: 9708fda28ccd0466cb0a8fd409854ab4d92f7dca - this commit: 6323b355bd7f5d2ce85d0244fe0883af3881df4e - this commit: 28282bc644054e157c3b9a3d38f1f9551ce09074 - and this commit: 98a0688036e9dbcf43fa84960d9a1ef3e09a69cf ### Workarounds As a temporary measure until the patch can be applied, users can add the environment variable `DISABLE_TF_LOGS` to the tf-runners via the runner pod template of the Terraform Custom Resource. This will prevent the logging of sensitive information and mitigate the risk of this vulnerability. ### References - The first issue: https://github.com/weaveworks/tf-controller/issues/637 - The second issue: https://github.com/weaveworks/tf-controller/issues/649 ### For More Information If you have any further questions or comments about this advisory: Open an issue in the Weave GitOps Terraform Controller repository Email us at [security@weave.works](mailto:security@weave.works)

CVE-2023-34236 Affected Github.com/weaveworks/tf controller Versions

2 component(s)
Fixed Versions:
0.14.40.15.0-rc.5
Product / Package Ecosystem Affected Versions Fixed Version
github.com/weaveworks/tf-controller
Go
< 0.14.4
0.14.4
github.com/weaveworks/tf-controller
Go
≥ 0.15.0-rc.1
< 0.15.0-rc.5
0.15.0-rc.5

References

Frequently Asked Questions

What is CVE-2023-34236?
CVE-2023-34236 is a security vulnerability in Github.com/weaveworks/tf controller involving Weave GitOps Terraform Controller Information Disclosure Vulnerability under CWE-312: Cleartext Storage of Sensitive Information.
Which Github.com/weaveworks/tf controller versions are affected?
Affected versions include releases prior to 0.14.4, 0.15.0-rc.5 across affected packages: github.com/weaveworks/tf-controller.
What version fixes CVE-2023-34236?
Upgrading to 0.14.4, 0.15.0-rc.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/weaveworks/tf-controller affected?
Yes, github.com/weaveworks/tf-controller is affected in releases prior to 0.14.4, 0.15.0-rc.5. Upgrade your dependency to 0.14.4, 0.15.0-rc.5 or later.
What is the CVSS score of CVE-2023-34236?
CVE-2023-34236 has a CVSS v3.1 base score of 8.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N.
What CWE is associated with CVE-2023-34236?
CVE-2023-34236 is classified under CWE-312: Cleartext Storage of Sensitive Information (The product stores sensitive information in cleartext within a resource that might be accessible to another control sphere.).
How can I check Go dependencies for CVE-2023-34236?
Run the dependency tree command: 'inspect dependencies for github.com/weaveworks/tf-controller'. 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-6hvv-j432-23cv",
  "modified" : "2023-07-14T21:52:09Z",
  "published" : "2023-07-14T21:52:09Z",
  "aliases" : [ "CVE-2023-34236" ],
  "summary" : "Weave GitOps Terraform Controller Information Disclosure Vulnerability",
  "details" : "### Impact\n\nA vulnerability has been identified in Weave GitOps Terraform Controller which could allow an authenticated remote attacker to view sensitive information. This vulnerability stems from Weave GitOps Terraform Runners (`tf-runner`), where sensitive data is inadvertently printed - potentially revealing sensitive user data in their pod logs. In particular, functions `tfexec.ShowPlan`, `tfexec.ShowPlanRaw`, and `tfexec.Output` are implicated when the `tfexec` object set its `Stdout` and `Stderr` to be `os.Stdout` and `os.Stderr`.\n\nAn unauthorized remote attacker could exploit this vulnerability by accessing these prints of sensitive information, which may contain configurations or tokens that could be used to gain unauthorized control or access to resources managed by the Terraform controller.\n\nA successful exploit could allow the attacker to utilize this sensitive data, potentially leading to unauthorized access or control of the system.\n\n### Patches\n\nThis vulnerability has been addressed in Weave GitOps Terraform Controller versions `v0.14.4` and `v0.15.0-rc.5`. Users are urged to upgrade to one of these versions to mitigate the vulnerability.\n\nThe patches for this vulnerability are found in:\n- this commit: 9708fda28ccd0466cb0a8fd409854ab4d92f7dca\n- this commit: 6323b355bd7f5d2ce85d0244fe0883af3881df4e\n- this commit: 28282bc644054e157c3b9a3d38f1f9551ce09074\n- and this commit: 98a0688036e9dbcf43fa84960d9a1ef3e09a69cf\n\n### Workarounds\n\nAs a temporary measure until the patch can be applied, users can add the environment variable `DISABLE_TF_LOGS` to the tf-runners via the runner pod template of the Terraform Custom Resource. This will prevent the logging of sensitive information and mitigate the risk of this vulnerability.\n\n### References\n\n- The first issue: https://github.com/weaveworks/tf-controller/issues/637\n- The second issue: https://github.com/weaveworks/tf-controller/issues/649\n\n### For More Information\n\nIf you have any further questions or comments about this advisory:\n\nOpen an issue in the Weave GitOps Terraform Controller repository\nEmail us at [security@weave.works](mailto:security@weave.works)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/weaveworks/tf-controller"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.14.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/weaveworks/tf-controller"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.15.0-rc.1"
      }, {
        "fixed" : "0.15.0-rc.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/weaveworks/tf-controller/security/advisories/GHSA-6hvv-j432-23cv"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-34236"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/weaveworks/tf-controller/issues/637"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/weaveworks/tf-controller/issues/649"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/weaveworks/tf-controller/commit/28282bc644054e157c3b9a3d38f1f9551ce09074"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/weaveworks/tf-controller/commit/6323b355bd7f5d2ce85d0244fe0883af3881df4e"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/weaveworks/tf-controller/commit/9708fda28ccd0466cb0a8fd409854ab4d92f7dca"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/weaveworks/tf-controller/commit/98a0688036e9dbcf43fa84960d9a1ef3e09a69cf"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/weaveworks/tf-controller"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-312", "CWE-522", "CWE-532" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-14T21:52:09Z",
    "nvd_published_at" : "2023-07-14T22:15:09Z"
  }
}