Kestrel
대시보드로 돌아가기
CVE-2026-54447HIGH· 8.4GHSA대응게시일: 2026. 07. 15.수정일: 2026. 07. 15.

garminconnect Has Insecure Permission Assignment for Garmin OAuth Token Store

위협 신호 · CVSS · EPSS · KEV

정기 패치· 높은 악용 신호 없음
CVSS
8.4high

이론적 심각도 점수

EPSS

예측 데이터 없음

KEV
미등재

실측 악용 기록 없음

권장 대응 기한차기 업그레이드 시CISA SSVC 기준

별도 긴급 패치 불필요 — 정기 시스템 업그레이드 주기에 맞춰 조치

· KEV 미등재 · 자동화 어려움 · 부분 영향 · 내부 한정

CVSS 벡터 · 메트릭

악용 경로
공격 벡터로컬
공격 복잡도낮음
필요 권한낮음
사용자 상호작용불필요
범위변경
영향
기밀성 영향높음
무결성 영향높음
가용성 영향없음
버전별 점수
CVSS 3.18.4HIGH
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N

상세 설명

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
1def dump(self, path: str) -> None:
2 p = Path(path).expanduser()
3 if p.is_dir() or not p.name.endswith(".json"):
4 p = p / "garmin_tokens.json"
5 p.parent.mkdir(parents=True, exist_ok=True) # no mode=
6 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.json0o644 (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:

text
1p.parent.mkdir(mode=0o700, parents=True, exist_ok=True)
2with contextlib.suppress(OSError):
3 p.parent.chmod(0o700)
4flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
5if hasattr(os, "O_NOFOLLOW"):
6 flags |= os.O_NOFOLLOW
7fd = os.open(p, flags, 0o600)
8with os.fdopen(fd, "w", encoding="utf-8") as f:
9 f.write(self.dumps())
10with contextlib.suppress(OSError):
11 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:

text
1chmod 700 ~/.garminconnect
2chmod 600 ~/.garminconnect/garmin_tokens.json

Remediation

  1. Upgrade to garminconnect >= 0.3.5:
    text
    1pip 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
    1chmod 600 ~/.garminconnect/garmin_tokens.json
    2# 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.

AI 심층 분석

공격 시나리오 · 재현 가능한 PoC 페이로드 · 즉시 적용 가능한 차단 패치를 한 번에 받아 보세요. 보안 운영팀이 그대로 점검·티켓팅에 쓸 수 있는 형태로 정리해 드립니다.