CVE-2026-141426: The Google Drive client secret is written with permissions readable by other local users in whatstk
Incorrect Default Permissions (CWE-276) in gdriveinit() (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 clientsecrets.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 gdriveinit 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 0.9.0 - Operational
After upgrading, run gdrive_init once to tighten permissions on the directory and files left behind by an earlier version.
Event History
Frequently Asked Questions
Which deployments are exposed to other users reading these files?
Deployments running affected whatstk versions on multi-user machines are exposed when the active umask and permissions on parent directories allow traversal and reading. With a typical umask of 022, the gdrive directory is 0755 and client_secrets.json and settings.yaml are 0644, making them readable by other local users.
Does restricting the original client secret file to mode 0600 prevent exposure?
No. The client secret is copied with shutil.copyfile, which does not preserve the source file's permissions; its resulting permissions are determined by the umask in force when gdrive_init() runs.
What information is exposed, and is the OAuth refresh token included?
Other local users may read the Google Drive OAuth client secret in client_secrets.json and generated settings in settings.yaml. The refresh token in credentials.json is written by pydrive2 and is observed with mode 0600.
What can be done if updating is not immediately possible?
Run gdrive_init() with a restrictive umask and ensure the ~/.config/whatstk/gdrive directory and its files are accessible only to the owning user. Existing files created with permissive modes should also be corrected, since the issue depends on current file and parent-directory permissions.
How can an administrator identify an affected installation?
Check whether whatstk is from 0.5.0 before 0.9.0, then inspect ~/.config/whatstk/gdrive, client_secrets.json, and settings.yaml permissions. Modes such as 0755 on the directory and 0644 on either file indicate that other local users may be able to read them, subject to parent-directory access.