CVE-2024-3250: Github.com/canonical/pebble Pebble Service Manager's File Pull Vulnerability

MODERATE
Advisory Identifier: GHSA-4685-2x5r-65pj
CVSS 6.5
CWE-862
Published
Advisory Summary

CVE-2024-3250 is a MODERATE (CVSS 6.5) pebble service manager's file pull vulnerability (CWE-862: Missing Authorization) affecting Github.com/canonical/pebble libraries in the Go ecosystem. The issue involves pebble service manager's file pull api allows access by any user. Remediation is available by upgrading affected packages to version 1.7.3, 1.4.2, 1.10.2, 1.1.1.

CVE-2024-3250 at a Glance

CVE Identifier CVE-2024-3250
GHSA Identifier GHSA-4685-2x5r-65pj
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-862: Missing Authorization
Affected Product Github.com/canonical/pebble
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.5

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

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

How to Fix CVE-2024-3250

To remediate this vulnerability, upgrade all affected Github.com/canonical/pebble 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/canonical/pebble fixed: 1.7.3
Upgrade github.com/canonical/pebble to 1.7.3
github.com/canonical/pebble fixed: 1.4.2
Upgrade github.com/canonical/pebble to 1.4.2
github.com/canonical/pebble fixed: 1.10.2
Upgrade github.com/canonical/pebble to 1.10.2
github.com/canonical/pebble fixed: 1.1.1
Upgrade github.com/canonical/pebble to 1.1.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 github.com/canonical/pebble

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-3250, inspect your project dependencies for Github.com/canonical/pebble:

inspect dependencies for github.com/canonical/pebble

Analyze the terminal output to locate any version of Github.com/canonical/pebble in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.7.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-862: Missing Authorization, where the product does not perform an authorization check when an actor attempts to access a resource or perform an action. In Github.com/canonical/pebble, 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 Note: "Pebble" here refers to [Canonical's service manager](https://github.com/canonical/pebble), not the [Let's Encrypt ACME test server](https://github.com/letsencrypt/pebble). 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 https://github.com/canonical/pebble/commit/cd326225b9b0be067da7d8858e2c912078cbbbd5. There's also https://github.com/canonical/pebble/pull/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: - https://github.com/canonical/pebble/releases/tag/v1.1.1 - https://github.com/canonical/pebble/releases/tag/v1.4.2 - https://github.com/canonical/pebble/releases/tag/v1.7.4 - https://github.com/canonical/pebble/releases/tag/v1.10.2 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 * https://www.cve.org/CVERecord?id=CVE-2024-3250

CVE-2024-3250 Affected Github.com/canonical/pebble Versions

4 component(s)
Fixed Versions:
1.7.31.4.21.10.21.1.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/canonical/pebble
Go
≥ 1.5.0
< 1.7.3
1.7.3
github.com/canonical/pebble
Go
≥ 1.2.0
< 1.4.2
1.4.2
github.com/canonical/pebble
Go
≥ 1.8.0
< 1.10.2
1.10.2
github.com/canonical/pebble
Go
< 1.1.1
1.1.1

References

Frequently Asked Questions

What is CVE-2024-3250?
CVE-2024-3250 is a security vulnerability in Github.com/canonical/pebble involving Pebble service manager's file pull API allows access by any user under CWE-862: Missing Authorization.
Which Github.com/canonical/pebble versions are affected?
Affected versions include releases prior to 1.7.3, 1.4.2, 1.10.2, 1.1.1 across affected packages: github.com/canonical/pebble.
What version fixes CVE-2024-3250?
Upgrading to 1.7.3, 1.4.2, 1.10.2, 1.1.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/canonical/pebble affected?
Yes, github.com/canonical/pebble is affected in releases prior to 1.7.3, 1.4.2, 1.10.2, 1.1.1. Upgrade your dependency to 1.7.3, 1.4.2, 1.10.2, 1.1.1 or later.
What is the CVSS score of CVE-2024-3250?
CVE-2024-3250 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2024-3250?
CVE-2024-3250 is classified under CWE-862: Missing Authorization (The product does not perform an authorization check when an actor attempts to access a resource or perform an action.).
How can I check Go dependencies for CVE-2024-3250?
Run the dependency tree command: 'inspect dependencies for github.com/canonical/pebble'. 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-4685-2x5r-65pj",
  "modified" : "2024-04-05T15:07:16Z",
  "published" : "2024-04-05T15:03:03Z",
  "aliases" : [ "CVE-2024-3250" ],
  "summary" : "Pebble service manager's file pull API allows access by any user",
  "details" : "### Impact\n\nNote: \"Pebble\" here refers to [Canonical's service manager](https://github.com/canonical/pebble), not the [Let's Encrypt ACME test server](https://github.com/letsencrypt/pebble).\n\nThe 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.\n\nNote 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.\n\nTo 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.\n\n### Patches\n\nThe original patch is commit https://github.com/canonical/pebble/commit/cd326225b9b0be067da7d8858e2c912078cbbbd5. There's also https://github.com/canonical/pebble/pull/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).\n\nWe released the fix in the following Pebble versions:\n\n- https://github.com/canonical/pebble/releases/tag/v1.1.1\n- https://github.com/canonical/pebble/releases/tag/v1.4.2\n- https://github.com/canonical/pebble/releases/tag/v1.7.4\n- https://github.com/canonical/pebble/releases/tag/v1.10.2\n\nJuju will be releasing patch versions with this fix shortly:\n\n- Juju 2.9.49 (Pebble v1.1.1)\n- Juju 3.1.8 (Pebble v1.4.2)\n- Juju 3.3.4 (Pebble v1.4.2)\n- Juju 3.4.2 (Pebble v1.7.4)\n- Juju 3.5.0 (Pebble v1.10.2)\n\n### References\n\n* https://www.cve.org/CVERecord?id=CVE-2024-3250\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/canonical/pebble"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.2.0"
      }, {
        "fixed" : "1.4.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 1.4.1"
    }
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/canonical/pebble"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.5.0"
      }, {
        "fixed" : "1.7.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/canonical/pebble"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.8.0"
      }, {
        "fixed" : "1.10.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 1.10.1"
    }
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/canonical/pebble"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.1.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/canonical/pebble/security/advisories/GHSA-4685-2x5r-65pj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-3250"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/canonical/pebble/pull/406"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/canonical/pebble/commit/4ca343d3889533143477e21c63867f2f3c3b5645"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/canonical/pebble/commit/a5f6f062a11ea156697b854264385ff7e1985fd8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/canonical/pebble/commit/b8abd1ff0090f3e0749e81eb1fc3ea16ba95f514"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/canonical/pebble/commit/cd326225b9b0be067da7d8858e2c912078cbbbd5"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/canonical/pebble"
  }, {
    "type" : "WEB",
    "url" : "https://www.cve.org/CVERecord?id=CVE-2024-3250"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-862" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-05T15:03:03Z",
    "nvd_published_at" : null
  }
}