Skip to content

Go installation could be owned by wrong user

High
danielparks published GHSA-8h8m-h98f-vv84 Feb 29, 2024

Package

dp-golang (Puppet)

Affected versions

<1.2.7

Patched versions

1.2.7

Description

Summary

dp-golang could install files — including the compiler binary — with the wrong ownership when all of the following were true:

  • Puppet was run as root
  • Using dp-golang version < 1.2.7
  • The installed package was:
    • On macOS: Go version 1.4.3 through 1.21rc3, inclusive.
    • go1.4-bootstrap-20170518.tar.gz
    • go1.4-bootstrap-20170531.tar.gz

The user and group specified in Puppet code were ignored for files within the archive.

Explanation

dp-golang uses tar to extract Go installations into place. When running as root, tar by default honors the ownership of entries in the installation tarball. Go installation archives listed below have files owned by a non-root user, so tar applied that ownership as best it could on installation.

A check of the archives on https://go.dev/dl found a number of installation archives with files owned by gopher, kbuilder, or just UID 501 or 502.

  • For macOS: Go versions 1.4.3 through 1.21rc3, inclusive
  • go1.4-bootstrap-20170518.tar.gz
  • go1.4-bootstrap-20170531.tar.gz

Go versions 1.21.0 and beyond on macOS are not affected (all entries are owned by UID 0).

Impact

This could result in the Go installation being modifiable by a non-root user. In the worst case, the user could modify the compiler to insert vulnerabilities into packages that were then run by privileged users on the same system, or on other systems entirely.

Patches

dp-puppet version 1.2.7 will recreate installations if the owner or group of any file or directory within that installation does not match the requested owner or group. New and recreated installations will have the correct owner and group for all files and directories.

Workarounds

The Go installation may be chowned to the proper ownership, but this does not guarantee that it has not been modified.

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:H

CVE ID

CVE-2024-27294

Weaknesses

No CWEs