Skip to content

Secrets uploaded to local supabase vault using config.toml have their names converted to lowercase #3242

Open

Description

@fgh-james

Describe the bug

When running supabase locally and uploading secrets to the vault using config.toml, all uppercase letters in the secret name are converted to lowercase.

I am attempting to upload my vault secrets to my local supabase instance using the config.toml. All my secrets are written in all caps, and when they are uploaded to the vault, I see that they are converted to lowercase which breaks any references to them in my application.

Here is my config.toml setup:

[db.vault]
WEBHOOK_SECRET = "env(WEBHOOK_SECRET)"
WEBHOOK_SEND_INVITE_URL = "http://172.17.0.1:54321/functions/v1/send-invite"

And here is the result in the database:

Image

Then in my code, when I try to get my secret, it fails because the capitalization is incorrect:

select decrypted_secret into secret from vault.decrypted_secrets where name = 'WEBHOOK_SECRET' limit 1;

To Reproduce

  1. Add vault secrets to your config.toml
[db.vault]
WEBHOOK_SECRET = "env(WEBHOOK_SECRET)"
WEBHOOK_SEND_INVITE_URL = "http://172.17.0.1:54321/functions/v1/send-invite"
  1. Run supabase start
  2. Run supabase db reset to reseed the database and reset the vault
  3. Check in the supabase studio Table Editor > Schema > Vault > secrets
  4. See secret names loses all capitalization

Expected behavior

Secret names should retain their capitalization when uploaded through config.toml

System information

  • OS: macOS
  • Version of Supabase CLI (2.15.8)
  • Service Versions
    SERVICE IMAGE │ LOCAL │ LINKED
    supabase/postgres │ 15.1.1.19 │ 15.1.1.19
    supabase/gotrue │ v2.168.0 │ v2.168.0
    postgrest/postgrest │ v12.0.2 │ v12.0.2
    supabase/realtime │ v2.34.31 │ -
    supabase/storage-api │ v1.17.1 │ v1.17.1
    supabase/edge-runtime │ v1.67.2 │ -
    supabase/studio │ 20250224-d10db0f │ -
    supabase/postgres-meta │ v0.86.0 │ -
    supabase/logflare │ 1.11.0 │ -
    supabase/supavisor │ 2.3.9 │ -

Activity

  1. sweatybridge commented on Mar 5, 2025

    @sweatybridge
    Contributor

    After digging into this issue, I realised it is a fundamental flaw with viper not preserving case sensitive map keys spf13/viper#1014.

    I think we will have to migrate to koanf to fully resolve it.

  2. added theissue type on Mar 5, 2025
  3. lhengl commented on Jun 11, 2025

    @lhengl

    Just wanted to add that I came across this issue as well. I assumed it was just enforced as a recommended way to store the secret name. Glad it is flagged as a bug. I would really like the secret to mirror the env variables.

    Also, there is an issue when pushing the migration to remote using supabase db push. The vault secrets are pushed with each new migration push. This means that the remote secrets are always overriden by the local secrets after each push, not ideal considering you might want different secrets for different environment.

  4. g1ronn1mo commented on Apr 7, 2026

    @g1ronn1mo

    Is this fixed now?

  5. github-actions commented on Jun 17, 2026

    @github-actions
    Contributor

    Hi! Thanks for opening this issue.

    We're closing this because it has not had any activity for 45 days, and we try to keep the Supabase CLI issue tracker focused on reports that are still current.

    If this still reproduces on the latest Supabase CLI, please comment with /reopen on its own line and include your CLI version, updated reproduction steps, and any recent error output. We appreciate the signal and are happy to take another look.

  6. added
    stale-closed
    on Jun 17, 2026
  7. cpannwitz commented on Jun 18, 2026

    @cpannwitz

    /reopen
    Please reopen, this is neither answered nor resolved.

  8. reopened this on Jun 18, 2026
  9. github-actions commented on Aug 3, 2026

    @github-actions
    Contributor

    Hi! Thanks for opening this issue.

    We're closing this because it has not had any activity for 45 days, and we try to keep the Supabase CLI issue tracker focused on reports that are still current.

    If this still reproduces on the latest Supabase CLI, please comment with /reopen on its own line and include your CLI version, updated reproduction steps, and any recent error output. We appreciate the signal and are happy to take another look.

  10. nannestad commented on Sep 24, 2026

    @nannestad

    /reopen

    We reproduced this behavior on 24 September 2026 through Supabase’s hosted GitHub integration / Preview Branch deployment.

    Important distinction: our local and GitHub Actions tests using Supabase CLI 2.117.0 preserve uppercase Vault names correctly, including startup, updates and reset. The hosted branching deployment still lowercases them. We cannot determine which CLI version or implementation the managed executor uses.

    Reproduction

    1. Have an existing Vault secret named DB_TRIGGER_VERIFICATION_TOKEN.
    2. Configure Vault and Edge Functions to use the same input:
    [db.vault]
    DB_TRIGGER_VERIFICATION_TOKEN = "env(CONFIG_DB_TRIGGER_VERIFICATION_TOKEN_DEVELOPMENT)"
    
    [edge_runtime.secrets]
    DB_TRIGGER_VERIFICATION_TOKEN = "env(CONFIG_DB_TRIGGER_VERIFICATION_TOKEN_DEVELOPMENT)"
    1. Supply that input through the dotenvx-encrypted .env.preview, using a test value different from the existing Vault value.
    2. Push the configuration and let Supabase’s GitHub integration deploy the Preview.
    3. Inspect the resulting names:
    select name
    from vault.secrets
    where lower(name) = 'db_trigger_verification_token';

    Actual result

    The deployment reports success, but Vault contains two entries:

    • DB_TRIGGER_VERIFICATION_TOKEN: the original record, with its value unchanged.
    • db_trigger_verification_token: a newly created record containing the configured value.

    We compared SHA-256 digests without exposing plaintext. The lowercase entry matches the deployed Edge Function secret; the uppercase entry does not. Existing SQL consumers therefore continue reading the wrong value.

    Expected result

    Update the existing uppercase record, preserving its name and creating no lowercase duplicate.

    Could you reopen this, or route it to the team responsible for the hosted branching executor? The hosted behavior remains reproducible even though the local CLI path now works correctly.

  11. removed
    stale-closed
    on Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions