GHSA-x5c7-x7m2-rhmf: Go.mozilla.org/sops/v3 Local Directory Executable Lookup Vulnerability

LOW
Published
Advisory Summary

GHSA-x5c7-x7m2-rhmf is a LOW local directory executable lookup vulnerability (General Security Weakness) affecting Go.mozilla.org/sops/v3 libraries in the Go ecosystem. The issue involves local directory executable lookup in sops (windows-only). Remediation is available by upgrading affected packages to version 3.7.1.

GHSA-x5c7-x7m2-rhmf at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-x5c7-x7m2-rhmf
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Go.mozilla.org/sops/v3
Package Ecosystem Go
Published Date
Last Updated

How to Fix GHSA-x5c7-x7m2-rhmf

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

go.mozilla.org/sops/v3 fixed: 3.7.1
Upgrade go.mozilla.org/sops/v3 to 3.7.1
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 go.mozilla.org/sops/v3

How to Check if You Are Affected

To determine whether your application is affected by GHSA-x5c7-x7m2-rhmf, inspect your project dependencies for Go.mozilla.org/sops/v3:

inspect dependencies for go.mozilla.org/sops/v3

Analyze the terminal output to locate any version of Go.mozilla.org/sops/v3 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.7.1), 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 General Security Weakness. In Go.mozilla.org/sops/v3, 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 Windows users using the sops direct editor option (`sops file.yaml`) can have a local executable named either `vi`, `vim`, or `nano` executed if running sops from `cmd.exe` This attack is only viable if an attacker is able to place a malicious binary within the directory you are running sops from. As well, this attack will only work when using `cmd.exe` or the Windows C library [SearchPath function](https://docs.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv-searchpatha). This is a result of these Windows tools including `.` within their `PATH` by default. **If you are using sops within untrusted directories on Windows via `cmd.exe`, please upgrade immediately** **As well, if you have `.` within your default $PATH, please upgrade immediately.** More information can be found on the official Go blog: https://blog.golang.org/path-security ### Patches The problem has been resolved in v3.7.1 Now, if Windows users using cmd.exe run into this issue, a warning message will be printed: `vim resolves to executable in current directory (.\vim.exe)` ### References * https://blog.golang.org/path-security ### For more information If you have any questions or comments about this advisory: * Open a discussion in [sops](https://github.com/mozilla/sops/discussions)

GHSA-x5c7-x7m2-rhmf Affected Go.mozilla.org/sops/v3 Versions

1 component(s)
Fixed Versions:
3.7.1
Product / Package Ecosystem Affected Versions Fixed Version
go.mozilla.org/sops/v3
Go
< 3.7.1
3.7.1

References

Frequently Asked Questions

What is GHSA-x5c7-x7m2-rhmf?
GHSA-x5c7-x7m2-rhmf is a security vulnerability in Go.mozilla.org/sops/v3 involving Local directory executable lookup in sops (Windows-only) under General Security Weakness.
Which Go.mozilla.org/sops/v3 versions are affected?
Affected versions include releases prior to 3.7.1 across affected packages: go.mozilla.org/sops/v3.
What version fixes GHSA-x5c7-x7m2-rhmf?
Upgrading to 3.7.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is go.mozilla.org/sops/v3 affected?
Yes, go.mozilla.org/sops/v3 is affected in releases prior to 3.7.1. Upgrade your dependency to 3.7.1 or later.
What CWE is associated with GHSA-x5c7-x7m2-rhmf?
GHSA-x5c7-x7m2-rhmf is classified under General Security Weakness.
How can I check Go dependencies for GHSA-x5c7-x7m2-rhmf?
Run the dependency tree command: 'inspect dependencies for go.mozilla.org/sops/v3'. 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-x5c7-x7m2-rhmf",
  "modified" : "2021-05-20T16:50:13Z",
  "published" : "2021-05-20T16:50:34Z",
  "aliases" : [ ],
  "summary" : "Local directory executable lookup in sops (Windows-only)",
  "details" : "### Impact\nWindows users using the sops direct editor option (`sops file.yaml`) can have a local executable named either `vi`, `vim`, or `nano` executed if running sops from `cmd.exe`\n\nThis attack is only viable if an attacker is able to place a malicious binary within the directory you are running sops from. As well, this attack will only work when using `cmd.exe` or the Windows C library [SearchPath function](https://docs.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv-searchpatha). This is a result of these Windows tools including `.` within their `PATH` by default.\n\n**If you are using sops within untrusted directories on Windows via `cmd.exe`, please upgrade immediately** \n\n**As well, if you have `.` within your default $PATH, please upgrade immediately.**\n\nMore information can be found on the official Go blog: https://blog.golang.org/path-security\n\n### Patches\nThe problem has been resolved in v3.7.1\n\nNow, if Windows users using cmd.exe run into this issue, a warning message will be printed:\n`vim resolves to executable in current directory (.\\vim.exe)`\n\n### References\n* https://blog.golang.org/path-security\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open a discussion in [sops](https://github.com/mozilla/sops/discussions)",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "go.mozilla.org/sops/v3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.7.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mozilla/sops/security/advisories/GHSA-x5c7-x7m2-rhmf"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-20T16:50:13Z",
    "nvd_published_at" : null
  }
}