Description
Incorrect Default Permissions (CWE-276) in gdrive_init() (whatstk/utils/gdrive.py) in whatstk from 0.5.0 before 0.9.0 allows another user of the same machine to read the Google Drive OAuth client secret of the user who ran it. The function creates ~/.config/whatstk/gdrive with os.makedirs and no mode argument, copies the supplied client secret file to client_secrets.json with shutil.copyfile, and writes settings.yaml through a plain open call, so all three take whatever the process umask allows. Under a default umask of 022 the directory is created 0755 and both files 0644. shutil.copyfile does not carry the source file's permissions over, so a client secret the user had restricted to 0600 is written out at 0644. Whether the files end up readable by other local users therefore depends on the umask in force when gdrive_init runs and on the permissions of the directories above them, and not on the permissions of the file the user supplied. The refresh token in credentials.json is written by pydrive2 rather than by whatstk and is observed at 0600. This results in the OAuth client secret and the generated settings being readable in plain text by other users of the machine.
Published: 2026-12-01
Score: 2 Low
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Analysis and contextual insights are available on OpenCVE Cloud.

Remediation

Vendor Solution

Upgrade to whatstk 0.9.0 or later, which writes the directory at 0700 and the files at 0600. Running gdrive_init once on the upgraded version also tightens a directory and files left behind by an earlier version. Google Drive support is deprecated in 0.9.0 and the module is removed in 0.10.0, which does not carry this code at all.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 01 Dec 2026 19:30:00 +0000

Type Values Removed Values Added
Description Incorrect Default Permissions (CWE-276) in gdrive_init() (whatstk/utils/gdrive.py) in whatstk from 0.5.0 before 0.9.0 allows another user of the same machine to read the Google Drive OAuth client secret of the user who ran it. The function creates ~/.config/whatstk/gdrive with os.makedirs and no mode argument, copies the supplied client secret file to client_secrets.json with shutil.copyfile, and writes settings.yaml through a plain open call, so all three take whatever the process umask allows. Under a default umask of 022 the directory is created 0755 and both files 0644. shutil.copyfile does not carry the source file's permissions over, so a client secret the user had restricted to 0600 is written out at 0644. Whether the files end up readable by other local users therefore depends on the umask in force when gdrive_init runs and on the permissions of the directories above them, and not on the permissions of the file the user supplied. The refresh token in credentials.json is written by pydrive2 rather than by whatstk and is observed at 0600. This results in the OAuth client secret and the generated settings being readable in plain text by other users of the machine.
Title The Google Drive client secret is written with permissions readable by other local users in whatstk
First Time appeared Lucasrodes
Lucasrodes whatstk
Weaknesses CWE-276
CPEs cpe:2.3:a:lucasrodes:whatstk:*:*:*:*:*:python:*:*
Vendors & Products Lucasrodes
Lucasrodes whatstk
References
Metrics cvssV4_0

{'score': 2, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N'}


Subscriptions

Lucasrodes Whatstk
cve-icon MITRE

Status: PUBLISHED

Assigner: Secur0

Published:

Updated: 2026-12-01T19:09:50.674Z

Reserved: 2026-12-01T18:58:55.914Z

Link: CVE-2026-141426

cve-icon Vulnrichment

No data.

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

No data.

Weaknesses
  • CWE-276

    Incorrect Default Permissions