Vulnerabilities in pkg:pypi/garminconnect

PACKAGE
Advisory Identifier: GHSA-wjhr-76vg-2hvc
Advisory Summary

CVE-2026-54447 is a HIGH (CVSS 8.4) garminconnect has insecure permission assignment vulnerability (CWE-732: Incorrect Permission Assignment for Critical Resource) affecting Garminconnect libraries in the PyPI ecosystem. The issue involves garminconnect has insecure permission assignment for garmin oauth token store. Remediation is available by upgrading affected packages to version 0.3.5.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/garminconnect

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/garminconnect. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-wjhr-76vg-2hvc CVE-2026-54447 HIGH garminconnect Has Insecure Permission Assignment for Garmin OAuth Token Store

CVE-2026-54447 at a Glance

CVE Identifier CVE-2026-54447
GHSA Identifier GHSA-wjhr-76vg-2hvc
Severity HIGH
CVSS v3.1 Base Score 8.4
CWE Classification CWE-732: Incorrect Permission Assignment for Critical Resource
Affected Product Garminconnect
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.4

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:H/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 High (I:H)
Availability None (A:N)

How to Fix CVE-2026-54447

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

garminconnect fixed: 0.3.5
pip install garminconnect>=0.3.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show garminconnect

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-54447, inspect your installed packages using pip:

pip show garminconnect

Analyze the terminal output to locate any version of Garminconnect in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.3.5), your application is affected.

Note: The pip show garminconnect command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-732: Incorrect Permission Assignment for Critical Resource, where the product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors. In Garminconnect, 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

## Insecure Permission Assignment for Garmin OAuth Token Store ### Summary `garminconnect` (≤ 0.3.4) wrote its OAuth token store to disk without restricting file-system permissions. Under the default Linux umask (`022`) the token file `garmin_tokens.json` was created world-readable (`0o644`). The file contains the DI **refresh token**, so any other local user on a shared host could read it and obtain persistent, unauthorized access to the victim's Garmin Connect account. - **Severity:** High - **Weakness:** CWE-732 (Incorrect Permission Assignment for Critical Resource) - **Affected versions:** `<= 0.3.4` - **Patched version:** `0.3.5` ### Details `Client.dump()` created the token directory and file with no `mode` argument, leaving permissions entirely to the process umask: ```python def dump(self, path: str) -> None: p = Path(path).expanduser() if p.is_dir() or not p.name.endswith(".json"): p = p / "garmin_tokens.json" p.parent.mkdir(parents=True, exist_ok=True) # no mode= p.write_text(self.dumps()) # no permission restriction ``` The serialized payload includes `di_token`, `di_refresh_token`, and `di_client_id`. The call is in the core library (`Garmin.login(tokenstore=...)` persists tokens this way), and all shipped usage examples default the token store to `~/.garminconnect`. Under `umask 022` the resulting permissions were: - token directory → `0o755` - `garmin_tokens.json` → `0o644` (world-readable) A separate, unprivileged user on the same machine could read the file with a plain `open()` — no elevated privileges required — and extract the refresh token. ### Impact Local credential theft / privilege escalation on multi-user Linux or macOS hosts running under a permissive umask. The stolen refresh token can be exchanged for fresh access tokens via Garmin's OAuth endpoint, granting ongoing access to the victim's account (health/fitness data, activity history, device management) until the token is revoked. ### Patch Fixed in **0.3.5** (commit `77a3837`). `dump()` now creates the directory as `0o700` and writes the token file as `0o600` regardless of umask — using `os.open(..., O_CREAT|O_WRONLY|O_TRUNC, 0o600)` with `O_NOFOLLOW` where available, plus a defensive `chmod` that also tightens a pre-existing loose file: ```python p.parent.mkdir(mode=0o700, parents=True, exist_ok=True) with contextlib.suppress(OSError): p.parent.chmod(0o700) flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC if hasattr(os, "O_NOFOLLOW"): flags |= os.O_NOFOLLOW fd = os.open(p, flags, 0o600) with os.fdopen(fd, "w", encoding="utf-8") as f: f.write(self.dumps()) with contextlib.suppress(OSError): p.chmod(0o600) ``` Verified under `umask 022`: directory `0o700`, file `0o600`, no group/other access. ### Workarounds If you cannot upgrade immediately, restrict the token store manually and keep it owner-only: ```bash chmod 700 ~/.garminconnect chmod 600 ~/.garminconnect/garmin_tokens.json ``` ### Remediation 1. **Upgrade** to `garminconnect >= 0.3.5`: ```bash pip install --upgrade garminconnect ``` 2. **Fix any token file already on disk** — upgrading only tightens permissions on the *next* write, so an existing world-readable file stays exposed until then: ```bash chmod 600 ~/.garminconnect/garmin_tokens.json # or remove it and log in again to mint a fresh token store ``` 3. **If the file was exposed on a shared host, treat the refresh token as compromised.** Re-authenticate (delete the token store and log in again) so a new token is issued; consider the previously stored token potentially read by others until rotated. ### Credit Reported by **EQSTLab** via a private security advisory. garminconnect thanks them for the detailed, responsible disclosure.

CVE-2026-54447 Affected Garminconnect Versions

1 component(s)
Fixed Versions:
0.3.5
Product / Package Ecosystem Affected Versions Fixed Version
garminconnect
PyPI
< 0.3.5
0.3.5

References

Frequently Asked Questions

What is CVE-2026-54447?
CVE-2026-54447 is a security vulnerability in Garminconnect involving garminconnect Has Insecure Permission Assignment for Garmin OAuth Token Store under CWE-732: Incorrect Permission Assignment for Critical Resource.
Which Garminconnect versions are affected?
Affected versions include releases prior to 0.3.5 across affected packages: garminconnect.
What version fixes CVE-2026-54447?
Upgrading to 0.3.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is garminconnect affected?
Yes, garminconnect is affected in releases prior to 0.3.5. Upgrade your dependency to 0.3.5 or later.
What is the CVSS score of CVE-2026-54447?
CVE-2026-54447 has a CVSS v3.1 base score of 8.4 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N.
What CWE is associated with CVE-2026-54447?
CVE-2026-54447 is classified under CWE-732: Incorrect Permission Assignment for Critical Resource (The product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.).
How can I check PyPI dependencies for CVE-2026-54447?
Run the dependency tree command: 'pip show garminconnect'. 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-wjhr-76vg-2hvc",
  "modified" : "2026-07-15T17:33:00Z",
  "published" : "2026-07-15T17:33:00Z",
  "aliases" : [ "CVE-2026-54447" ],
  "summary" : "garminconnect Has Insecure Permission Assignment for Garmin OAuth Token Store",
  "details" : "## Insecure Permission Assignment for Garmin OAuth Token Store\n\n### Summary\n\n`garminconnect` (≤ 0.3.4) wrote its OAuth token store to disk without restricting file-system permissions. Under the default Linux umask (`022`) the token file `garmin_tokens.json` was created world-readable (`0o644`). The file contains the DI **refresh token**, so any other local user on a shared host could read it and obtain persistent, unauthorized access to the victim's Garmin Connect account.\n\n- **Severity:** High\n- **Weakness:** CWE-732 (Incorrect Permission Assignment for Critical Resource)\n- **Affected versions:** `<= 0.3.4`\n- **Patched version:** `0.3.5`\n\n### Details\n\n`Client.dump()` created the token directory and file with no `mode` argument, leaving permissions entirely to the process umask:\n\n```python\ndef dump(self, path: str) -> None:\n    p = Path(path).expanduser()\n    if p.is_dir() or not p.name.endswith(\".json\"):\n        p = p / \"garmin_tokens.json\"\n    p.parent.mkdir(parents=True, exist_ok=True)   # no mode=\n    p.write_text(self.dumps())                     # no permission restriction\n```\n\nThe serialized payload includes `di_token`, `di_refresh_token`, and `di_client_id`. The call is in the core library (`Garmin.login(tokenstore=...)` persists tokens this way), and all shipped usage examples default the token store to `~/.garminconnect`.\n\nUnder `umask 022` the resulting permissions were:\n\n- token directory → `0o755`\n- `garmin_tokens.json` → `0o644` (world-readable)\n\nA separate, unprivileged user on the same machine could read the file with a plain `open()` — no elevated privileges required — and extract the refresh token.\n\n### Impact\n\nLocal credential theft / privilege escalation on multi-user Linux or macOS hosts running under a permissive umask. The stolen refresh token can be exchanged for fresh access tokens via Garmin's OAuth endpoint, granting ongoing access to the victim's account (health/fitness data, activity history, device management) until the token is revoked.\n\n### Patch\n\nFixed in **0.3.5** (commit `77a3837`). `dump()` now creates the directory as `0o700` and writes the token file as `0o600` regardless of umask — using `os.open(..., O_CREAT|O_WRONLY|O_TRUNC, 0o600)` with `O_NOFOLLOW` where available, plus a defensive `chmod` that also tightens a pre-existing loose file:\n\n```python\np.parent.mkdir(mode=0o700, parents=True, exist_ok=True)\nwith contextlib.suppress(OSError):\n    p.parent.chmod(0o700)\nflags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC\nif hasattr(os, \"O_NOFOLLOW\"):\n    flags |= os.O_NOFOLLOW\nfd = os.open(p, flags, 0o600)\nwith os.fdopen(fd, \"w\", encoding=\"utf-8\") as f:\n    f.write(self.dumps())\nwith contextlib.suppress(OSError):\n    p.chmod(0o600)\n```\n\nVerified under `umask 022`: directory `0o700`, file `0o600`, no group/other access.\n\n### Workarounds\n\nIf you cannot upgrade immediately, restrict the token store manually and keep it owner-only:\n\n```bash\nchmod 700 ~/.garminconnect\nchmod 600 ~/.garminconnect/garmin_tokens.json\n```\n\n### Remediation\n\n1. **Upgrade** to `garminconnect >= 0.3.5`:\n   ```bash\n   pip install --upgrade garminconnect\n   ```\n2. **Fix any token file already on disk** — upgrading only tightens permissions\n   on the *next* write, so an existing world-readable file stays exposed until\n   then:\n   ```bash\n   chmod 600 ~/.garminconnect/garmin_tokens.json\n   # or remove it and log in again to mint a fresh token store\n   ```\n3. **If the file was exposed on a shared host, treat the refresh token as\n   compromised.** Re-authenticate (delete the token store and log in again) so\n   a new token is issued; consider the previously stored token potentially\n   read by others until rotated.\n\n### Credit\n\nReported by **EQSTLab** via a private security advisory. garminconnect thanks them for the detailed, responsible disclosure.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "garminconnect"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.3.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.3.4"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cyberjunky/python-garminconnect/security/advisories/GHSA-wjhr-76vg-2hvc"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cyberjunky/python-garminconnect/commit/77a3837f1f79d486663c9646438e70e8319e1a48"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cyberjunky/python-garminconnect/commit/f74174a5647e1af78eca1f8f3a0aa5dc5a899947"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cyberjunky/python-garminconnect"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cyberjunky/python-garminconnect/releases/tag/0.3.5"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-732" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-15T17:33:00Z",
    "nvd_published_at" : null
  }
}