Vulnerabilities in pkg:golang/github.com/tursodatabase/turso-cli

PACKAGE
Advisory Identifier: GHSA-57f6-pvx8-hwj6
Advisory Summary

CVE-2026-48790 is a MODERATE (CVSS 5.5) turso-cli persists turso platform jwt vulnerability (CWE-732: Incorrect Permission Assignment for Critical Resource) affecting Github.com/tursodatabase/turso cli libraries in the Go ecosystem. The issue involves turso-cli persists turso platform jwt with world-readable (0o644) file permissions. Remediation is available by upgrading affected packages to version 1.0.26.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/tursodatabase/turso-cli

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/tursodatabase/turso-cli. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-57f6-pvx8-hwj6 CVE-2026-48790 MODERATE turso-cli persists Turso platform JWT with world-readable (0o644) file permissions

CVE-2026-48790 at a Glance

CVE Identifier CVE-2026-48790
GHSA Identifier GHSA-57f6-pvx8-hwj6
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification CWE-732: Incorrect Permission Assignment for Critical Resource
Affected Product Github.com/tursodatabase/turso cli
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.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:U/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 Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-48790

To remediate this vulnerability, upgrade all affected Github.com/tursodatabase/turso cli 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/tursodatabase/turso-cli fixed: 1.0.26
Upgrade github.com/tursodatabase/turso-cli to 1.0.26
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/tursodatabase/turso-cli

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-48790, inspect your project dependencies for Github.com/tursodatabase/turso cli:

inspect dependencies for github.com/tursodatabase/turso-cli

Analyze the terminal output to locate any version of Github.com/tursodatabase/turso cli in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.26), 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-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 Github.com/tursodatabase/turso cli, 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

### Summary `turso-cli` persists the user's Turso platform JWT to `settings.json` using Viper's default `configPermissions` of `0o644`, leaving the credential file world-readable on standard Linux and macOS systems. Any other local UID on the host can read the file and recover the platform JWT, which grants full Turso platform access scoped to the user's organizations. ### Impact The token in `settings.json` grants the holder full Turso platform access — create or destroy databases, rotate credentials, exfiltrate data, change billing settings — for any organization the user belongs to. Because the file is world-readable, the credential is reachable by: - Cron jobs or daemons running as a different system user on the same host - Sandboxed CI runners with a mounted home directory - Containers with a bind-mounted host home - Co-tenants on a shared multi-user developer or jumpbox host The file path resolves through `configdir.LocalConfig("turso")`: - macOS: `~/Library/Application Support/turso/settings.json` - Linux: `~/.config/turso/settings.json` (or `$XDG_CONFIG_HOME/turso/settings.json`) It contains the platform JWT in plaintext JSON alongside `organization` and `username` fields. Comparable CLIs (`gh`, `aws`, `docker`, `gcloud`, plus close peers `planetscale`, `neon`, `upstash`) write credential files at `0o600` explicitly, so this is a deviation from the cross-vendor baseline rather than a deliberate trade-off. ### Details The OAuth callback handler stores the platform JWT via the settings layer: ```go // internal/cmd/auth.go:205-214 jwt, err := callbackServer.Result() ... settings.SetToken(jwt) ``` `SetToken` writes through Viper: ```go // internal/settings/settings.go:124-127 func (s *Settings) SetToken(token string) { viper.Set("token", token) s.changed = true } ``` Persistence runs through `viper.WriteConfig`: ```go // internal/settings/settings.go:96-101 func TryToPersistChanges() error { if err := viper.WriteConfig(); err != nil { return fmt.Errorf("failed to persist turso settings file: %w", err) } return nil } ``` Viper v1.21.0 (pinned in `turso-cli` `go.mod`) initializes `configPermissions` to `os.FileMode(0o644)` at `viper.go:198` and passes that mode straight to `os.OpenFile` at `viper.go:1688`. Without a call to `viper.SetConfigPermissions(0o600)`, the resulting `settings.json` is created at `0o644`. A `grep` over the auth-config write path under `internal/` returns zero hits for `Chmod`, `0o600`, or `0600`, confirming there is no follow-up tightening of the file mode anywhere on the persistence path. ### Proof of concept Minimal reproducer using the same Viper version `turso-cli` pins (`github.com/spf13/viper v1.21.0`): ```go package main import ( "fmt" "os" "path/filepath" "github.com/spf13/viper" ) func main() { dir, _ := os.MkdirTemp("", "viperpoc-*") defer os.RemoveAll(dir) viper.SetConfigName("settings") viper.SetConfigType("json") viper.AddConfigPath(dir) viper.Set("token", "FAKE_TURSO_JWT_xxxxxxxxxxxxxxxxxxxx") viper.Set("organization", "exampleorg") viper.SafeWriteConfig() st, _ := os.Stat(filepath.Join(dir, "settings.json")) fmt.Printf("mode: %o\n", st.Mode()&0o777) } ``` $ go run main.go mode: 644 The same `SafeWriteConfig` / `WriteConfig` calls `turso-cli` uses produce the same `0o644` mode in a real `turso auth login` flow. ### Remediation One-line fix at the existing Viper configuration site in `internal/settings/settings.go` (around lines 48-50): ```go viper.SetConfigName("settings") viper.SetConfigType("json") viper.AddConfigPath(configPath) viper.SetConfigPermissions(0o600) // restrict settings.json to owner only ``` Defense in depth: - Add `os.Chmod(configFile, 0o600)` after `TryToPersistChanges`, or on read (as PlanetScale does in `internal/config/config.go` — they `Stat` the token file and self-heal if `Mode() &^ 0o600` is nonzero). `viper.SetConfigPermissions` applies only on file creation, so an existing wider-mode file is not tightened otherwise. - Add `os.Chmod(configPath, 0o700)` after `configdir.MakePath(configPath)` (line 43) to close the equivalent gap on the enclosing directory, which is otherwise created under the default umask. Patch: https://github.com/tursodatabase/turso-cli/commit/ffb914849216ef5a86353b3fa6cee66f33af3b66 ### Workarounds Until upgraded, users can tighten the existing files manually: ```sh # Linux chmod 600 ~/.config/turso/settings.json chmod 700 ~/.config/turso # macOS chmod 600 "$HOME/Library/Application Support/turso/settings.json" chmod 700 "$HOME/Library/Application Support/turso" ``` This must be repeated after any operation that recreates the file (e.g. `turso auth login`) until the patched version is installed. ### Resources - Patch commit: https://github.com/tursodatabase/turso-cli/commit/ffb914849216ef5a86353b3fa6cee66f33af3b66 - Viper `configPermissions` default: https://github.com/spf13/viper/blob/v1.21.0/viper.go#L198 - Viper write path: https://github.com/spf13/viper/blob/v1.21.0/viper.go#L1688 - CWE-276: https://cwe.mitre.org/data/definitions/276.html - CWE-732: https://cwe.mitre.org/data/definitions/732.html

CVE-2026-48790 Affected Github.com/tursodatabase/turso cli Versions

1 component(s)
Fixed Versions:
1.0.26
Product / Package Ecosystem Affected Versions Fixed Version
github.com/tursodatabase/turso-cli
Go
< 1.0.26
1.0.26

References

Frequently Asked Questions

What is CVE-2026-48790?
CVE-2026-48790 is a security vulnerability in Github.com/tursodatabase/turso cli involving turso-cli persists Turso platform JWT with world-readable (0o644) file permissions under CWE-732: Incorrect Permission Assignment for Critical Resource.
Which Github.com/tursodatabase/turso cli versions are affected?
Affected versions include releases prior to 1.0.26 across affected packages: github.com/tursodatabase/turso-cli.
What version fixes CVE-2026-48790?
Upgrading to 1.0.26 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/tursodatabase/turso-cli affected?
Yes, github.com/tursodatabase/turso-cli is affected in releases prior to 1.0.26. Upgrade your dependency to 1.0.26 or later.
What is the CVSS score of CVE-2026-48790?
CVE-2026-48790 has a CVSS v3.1 base score of 5.5 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-48790?
CVE-2026-48790 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 Go dependencies for CVE-2026-48790?
Run the dependency tree command: 'inspect dependencies for github.com/tursodatabase/turso-cli'. 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-57f6-pvx8-hwj6",
  "modified" : "2026-06-26T20:44:39Z",
  "published" : "2026-06-26T20:44:39Z",
  "aliases" : [ "CVE-2026-48790" ],
  "summary" : "turso-cli persists Turso platform JWT with world-readable (0o644) file permissions",
  "details" : "### Summary\n\n`turso-cli` persists the user's Turso platform JWT to `settings.json` using Viper's default `configPermissions` of `0o644`, leaving the credential file world-readable on standard Linux and macOS systems. Any other local UID on the host can read the file and recover the platform JWT, which grants full Turso platform access scoped to the user's organizations.\n\n### Impact\n\nThe token in `settings.json` grants the holder full Turso platform access — create or destroy databases, rotate credentials, exfiltrate data, change billing settings — for any organization the user belongs to.\n\nBecause the file is world-readable, the credential is reachable by:\n\n- Cron jobs or daemons running as a different system user on the same host\n- Sandboxed CI runners with a mounted home directory\n- Containers with a bind-mounted host home\n- Co-tenants on a shared multi-user developer or jumpbox host\n\nThe file path resolves through `configdir.LocalConfig(\"turso\")`:\n\n- macOS: `~/Library/Application Support/turso/settings.json`\n- Linux: `~/.config/turso/settings.json` (or `$XDG_CONFIG_HOME/turso/settings.json`)\n\nIt contains the platform JWT in plaintext JSON alongside `organization` and `username` fields.\n\nComparable CLIs (`gh`, `aws`, `docker`, `gcloud`, plus close peers `planetscale`, `neon`, `upstash`) write credential files at `0o600` explicitly, so this is a deviation from the cross-vendor baseline rather than a deliberate trade-off.\n\n### Details\n\nThe OAuth callback handler stores the platform JWT via the settings layer:\n\n```go\n// internal/cmd/auth.go:205-214\njwt, err := callbackServer.Result()\n...\nsettings.SetToken(jwt)\n```\n\n`SetToken` writes through Viper:\n\n```go\n// internal/settings/settings.go:124-127\nfunc (s *Settings) SetToken(token string) {\n    viper.Set(\"token\", token)\n    s.changed = true\n}\n```\n\nPersistence runs through `viper.WriteConfig`:\n\n```go\n// internal/settings/settings.go:96-101\nfunc TryToPersistChanges() error {\n    if err := viper.WriteConfig(); err != nil {\n        return fmt.Errorf(\"failed to persist turso settings file: %w\", err)\n    }\n    return nil\n}\n```\n\nViper v1.21.0 (pinned in `turso-cli` `go.mod`) initializes `configPermissions` to `os.FileMode(0o644)` at `viper.go:198` and passes that mode straight to `os.OpenFile` at `viper.go:1688`. Without a call to `viper.SetConfigPermissions(0o600)`, the resulting `settings.json` is created at `0o644`.\n\nA `grep` over the auth-config write path under `internal/` returns zero hits for `Chmod`, `0o600`, or `0600`, confirming there is no follow-up tightening of the file mode anywhere on the persistence path.\n\n### Proof of concept\n\nMinimal reproducer using the same Viper version `turso-cli` pins (`github.com/spf13/viper v1.21.0`):\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"os\"\n    \"path/filepath\"\n\n    \"github.com/spf13/viper\"\n)\n\nfunc main() {\n    dir, _ := os.MkdirTemp(\"\", \"viperpoc-*\")\n    defer os.RemoveAll(dir)\n\n    viper.SetConfigName(\"settings\")\n    viper.SetConfigType(\"json\")\n    viper.AddConfigPath(dir)\n\n    viper.Set(\"token\", \"FAKE_TURSO_JWT_xxxxxxxxxxxxxxxxxxxx\")\n    viper.Set(\"organization\", \"exampleorg\")\n    viper.SafeWriteConfig()\n\n    st, _ := os.Stat(filepath.Join(dir, \"settings.json\"))\n    fmt.Printf(\"mode: %o\\n\", st.Mode()&0o777)\n}\n```\n$ go run main.go mode: 644\n\nThe same `SafeWriteConfig` / `WriteConfig` calls `turso-cli` uses produce the same `0o644` mode in a real `turso auth login` flow.\n\n### Remediation\n\nOne-line fix at the existing Viper configuration site in `internal/settings/settings.go` (around lines 48-50):\n\n```go\nviper.SetConfigName(\"settings\")\nviper.SetConfigType(\"json\")\nviper.AddConfigPath(configPath)\nviper.SetConfigPermissions(0o600) // restrict settings.json to owner only\n```\n\nDefense in depth:\n\n- Add `os.Chmod(configFile, 0o600)` after `TryToPersistChanges`, or on read (as PlanetScale does in `internal/config/config.go` — they `Stat` the token file and self-heal if `Mode() &^ 0o600` is nonzero).  `viper.SetConfigPermissions` applies only on file creation, so an existing wider-mode file is not tightened otherwise.\n- Add `os.Chmod(configPath, 0o700)` after `configdir.MakePath(configPath)` (line 43) to close the equivalent gap on the enclosing directory, which is otherwise created under the default umask.\n\nPatch: https://github.com/tursodatabase/turso-cli/commit/ffb914849216ef5a86353b3fa6cee66f33af3b66\n\n### Workarounds\n\nUntil upgraded, users can tighten the existing files manually:\n\n```sh\n# Linux\nchmod 600 ~/.config/turso/settings.json\nchmod 700 ~/.config/turso\n\n# macOS\nchmod 600 \"$HOME/Library/Application Support/turso/settings.json\"\nchmod 700 \"$HOME/Library/Application Support/turso\"\n```\n\nThis must be repeated after any operation that recreates the file (e.g.\n`turso auth login`) until the patched version is installed.\n\n### Resources\n\n- Patch commit: https://github.com/tursodatabase/turso-cli/commit/ffb914849216ef5a86353b3fa6cee66f33af3b66\n- Viper `configPermissions` default: https://github.com/spf13/viper/blob/v1.21.0/viper.go#L198\n- Viper write path: https://github.com/spf13/viper/blob/v1.21.0/viper.go#L1688\n- CWE-276: https://cwe.mitre.org/data/definitions/276.html\n- CWE-732: https://cwe.mitre.org/data/definitions/732.html",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/tursodatabase/turso-cli"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.26"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.0.25"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/tursodatabase/turso-cli/security/advisories/GHSA-57f6-pvx8-hwj6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/tursodatabase/turso-cli"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-276", "CWE-732" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-26T20:44:39Z",
    "nvd_published_at" : null
  }
}