Skip to content

Pebble service manager's file pull API allows access by any user

Moderate severity GitHub Reviewed Published Apr 4, 2024 in canonical/pebble • Updated Apr 5, 2024

Package

gomod github.com/canonical/pebble (Go)

Affected versions

>= 1.2.0, < 1.4.1
>= 1.5.0, < 1.7.3
>= 1.8.0, < 1.10.1
< 1.1.1

Patched versions

1.4.2
1.7.3
1.10.2
1.1.1

Description

Impact

Note: "Pebble" here refers to Canonical's service manager, not the Let's Encrypt ACME test server.

The API behind pebble pull, used to read files from the workload container by Juju charms, allows access from any user, instead of just admin. In Juju Kubernetes sidecar charms, Pebble and the charm run as root, so they have full access. But if another restricted unix user gains local access to the container host, they could hit the Pebble GET /v1/files?action=read API and would be allowed to read any file in the workload container, for example an ssh key or database password or other sensitive information. If there are ssh keys they could then potentially ssh into the workload, or if something like a database password they could log into the database.

Note that this requires local user access to the host machine. It seems unlikely that an attacker could gain this level of access in a Juju Kubernetes context, but if someone did and there's sensitive information in files accessible to Pebble, the consequences are bad.

To reproduce the issue, go back to the Pebble version in Juju 2.9 (5842ea68c9c7), do pebble run as root in one terminal window, then in another terminal window, as a regular user, use the pebble pull CLI. You will be able to pull any file as a regular user.

Patches

The original patch is commit canonical/pebble@cd32622. There's also canonical/pebble#406, which fixes this issue in more recent Pebble versions (that PR also fixes a separate issue we introduced more recently, but hasn't been released in Juju yet).

We released the fix in the following Pebble versions:

Juju will be releasing patch versions with this fix shortly:

  • Juju 2.9.49 (Pebble v1.1.1)
  • Juju 3.1.8 (Pebble v1.4.2)
  • Juju 3.3.4 (Pebble v1.4.2)
  • Juju 3.4.2 (Pebble v1.7.4)
  • Juju 3.5.0 (Pebble v1.10.2)

References

References

@benhoyt benhoyt published to canonical/pebble Apr 4, 2024
Published to the GitHub Advisory Database Apr 5, 2024
Reviewed Apr 5, 2024
Last updated Apr 5, 2024

Severity

Moderate

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
Changed
Confidentiality
High
Integrity
None
Availability
None

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:C/C:H/I:N/A:N

EPSS score

0.043%
(10th percentile)

Weaknesses

CVE ID

CVE-2024-3250

GHSA ID

GHSA-4685-2x5r-65pj

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.