---
id: blog/en/supabase-storage-role-none-rls-2026
type: blog
language: en
title: "Supabase Storage: when role none resets the role instead of removing it"
description: A valid JWT carrying role none could return Supabase Storage to its table-owning PostgreSQL user and bypass row-level security policies.
summary: A valid JWT carrying role none could return Supabase Storage to its table-owning PostgreSQL user and bypass row-level security policies.
url: https://rootzero.eu/en/research/supabase-storage-role-none-rls-2026/
markdown_url: https://rootzero.eu/en/research/supabase-storage-role-none-rls-2026/index.md
author: rootzero
published: 2026-11-09T00:00:00.000Z
updated: null
tags:
  - Supabase
  - PostgreSQL
  - JWT
  - Authentication
  - Vulnerabilities
topics:
  - id: web-api
    name: Web and APIs
    url: https://rootzero.eu/en/research/topics/web-api/
  - id: vulnerabilities
    name: Vulnerabilities
    url: https://rootzero.eu/en/research/topics/vulnerabilities/
translations:
  en: https://rootzero.eu/en/research/supabase-storage-role-none-rls-2026/
  fr: https://rootzero.eu/research/supabase-storage-role-none-rls-2026/
reading_minutes: 4
content_origin: source-analysis
research_reference: null
research_status: null
vulnerabilities: []
references:
  - label: Supabase advisory
    url: https://github.com/supabase/storage/security/advisories/GHSA-fgvp-cqg6-q8h2
  - label: PostgreSQL row-security documentation
    url: https://www.postgresql.org/docs/current/ddl-rowsecurity.html
  - label: SET ROLE documentation
    url: https://www.postgresql.org/docs/current/sql-set-role.html
  - label: set_config documentation
    url: https://www.postgresql.org/docs/current/functions-admin.html
sections:
  - title: The role travels correctly from JWT to PostgreSQL
    level: 2
    url: https://rootzero.eu/en/research/supabase-storage-role-none-rls-2026/#the-role-travels-correctly-from-jwt-to-postgresql
  - title: A minimal proof of PostgreSQL semantics
    level: 2
    url: https://rootzero.eu/en/research/supabase-storage-role-none-rls-2026/#a-minimal-proof-of-postgresql-semantics
  - title: Why logs can mislead an investigation
    level: 2
    url: https://rootzero.eu/en/research/supabase-storage-role-none-rls-2026/#why-logs-can-mislead-an-investigation
  - title: A narrow but realistic condition
    level: 2
    url: https://rootzero.eu/en/research/supabase-storage-role-none-rls-2026/#a-narrow-but-realistic-condition
---

# Supabase Storage: when role none resets the role instead of removing it

> A valid JWT carrying role none could return Supabase Storage to its table-owning PostgreSQL user and bypass row-level security policies.

**The advisory was published on 6 November 2026; Supabase Storage 1.89.9 contains the fix.** A correctly signed JWT containing `role: "none"` could make Storage operations run as the PostgreSQL login user. When that user owned the tables and row-level security was not forced for the owner, RLS policies were bypassed. Disclosed consequences include reading private buckets, uploading objects and creating buckets.

A valid JWT signature is still required. An attacker cannot freely alter the role in an existing token: the [Supabase advisory](https://github.com/supabase/storage/security/advisories/GHSA-fgvp-cqg6-q8h2) requires a trusted issuer to produce a token with that value, for example through a custom access-token hook.

## The role travels correctly from JWT to PostgreSQL

Storage verifies the JWT signature, reads its `role` claim and establishes the PostgreSQL authorisation context through a parameterised call equivalent to:

```sql
SELECT set_config('role', $1, true);
```

Parameterisation prevents SQL injection. The problem is the legitimate semantics of the supplied value. In PostgreSQL, `none` is reserved: instead of selecting a role named `none`, it resets the effective role to the session user. In the Supabase configuration described by the advisory, that user is `supabase_storage_admin`, owner of the Storage tables.

RLS does not necessarily apply to a table owner. `FORCE ROW LEVEL SECURITY` is required to subject the owner to policies. The [PostgreSQL row-security documentation](https://www.postgresql.org/docs/current/ddl-rowsecurity.html) confirms the exception. Neither superuser privileges nor the `BYPASSRLS` attribute is required: table ownership is sufficient in the documented case.

```text
signed JWT, role = none
          │
          ▼
set_config('role', 'none', true)
          │
          ▼
reset to the session user
          │
          ▼
table owner, RLS not forced
```

Each component follows its local contract. Their composition turns a value that appears restrictive into higher privilege.

## A minimal proof of PostgreSQL semantics

The core behaviour can be verified without running Supabase Storage, creating a JWT or accessing a bucket. In a disposable PostgreSQL database where the session user may assume the `authenticated` role, this transaction demonstrates only the identity change:

```sql
BEGIN;
SELECT session_user, current_user;
SET LOCAL ROLE authenticated;
SELECT session_user, current_user;
SELECT set_config('role', 'none', true);
SELECT session_user, current_user;
ROLLBACK;
```

After `SET LOCAL ROLE`, `current_user` is `authenticated` while `session_user` remains the login identity. After `set_config('role', 'none', true)`, `current_user` returns to `session_user`. The [`SET ROLE` documentation](https://www.postgresql.org/docs/current/sql-set-role.html) defines this behaviour explicitly, and the [`set_config` documentation](https://www.postgresql.org/docs/current/functions-admin.html) confirms that the function corresponds to `SET`.

This micro-proof does not reproduce the Storage bypass. That would also require the table-owning login user, `storage` tables and their RLS, a trusted JWT issuer and a vulnerable service version. Isolating the primitive prevents a normal PostgreSQL property from being mislabelled as SQL injection.

## Why logs can mislead an investigation

Supabase says request logs may still show `role: none` and the caller identifier. Those fields come from the JWT, not from the role currently active in PostgreSQL. An investigator who reviews only the HTTP layer can see a low-privilege identity while the database executes as table owner.

Establishing the fact requires three correlated values: the validated JWT, the effective role in the database session and the result of the RLS policy for the requested object. Reading only the token or only the SQL request cannot reconstruct the authorisation context.

The case is specific to reserved value `none`. According to the advisory, PostgreSQL rejects an arbitrary nonexistent role; an absent or empty claim falls back to `anon`. It would be incorrect to conclude that every custom role value bypasses RLS.

## A narrow but realistic condition

Exploitation requires a component authorised to sign tokens to emit `role: none`. The public example is a custom access-token hook. This narrows exposure, but the condition sits in a place where teams add business logic and may interpret `none` as “no role” without knowing its PostgreSQL meaning.

Versions through **1.89.8** are affected; **1.89.9** rejects the value before applying the database context and returns `AccessDenied`. The hosted platform had already been fixed when the advisory was published. Self-hosted deployments must check the actual image or package; the version of a Supabase client does not describe the Storage service version.

Until updating, the vendor recommends fixing hooks and issuers that produce `none`, then rejecting the value at every exposed Storage entry point. Changing issuance alone does not neutralise tokens already delivered. A gateway rule is also incomplete if the Storage origin remains directly reachable.

After exposure, identify affected tokens and their lifetime, then examine private reads, uploads, bucket creation, S3 sessions and TUS operations associated with them. The advisory reports no active exploitation or number of affected customers. A vulnerable configuration therefore does not show that access occurred.

The failure does not oppose a “bad” application to a “good” database. It shows that a control value crossing systems must be validated according to the destination grammar. `none` is not neutral text in PostgreSQL.

**Primary sources:** [Supabase Storage advisory GHSA-fgvp-cqg6-q8h2](https://github.com/supabase/storage/security/advisories/GHSA-fgvp-cqg6-q8h2), [`SET ROLE NONE` semantics](https://www.postgresql.org/docs/current/sql-set-role.html), [table-owner exception to RLS](https://www.postgresql.org/docs/current/ddl-rowsecurity.html).
