# GHSA-9237-rg5p-rhfw: @saltcorn/data: Tenant user role is used for tenant creation role check

> Tenant admins can escalate privileges to root domain admin by exploiting role context mismatch during tenant creation.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 22 Apr 2026

## What is GHSA-9237-rg5p-rhfw?

GHSA-9237-rg5p-rhfw is a vulnerability in @saltcorn/data, published on 22 Apr 2026. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

## Summary

When a tenant admin is logged out of the root domain (e.g., saltcorn.com) but logged in to their own tenant space as admin, they can simply append `/tenant/create` to their tenant URL. The system reads the role from the tenant context (admin), and a new tenant is created on the **root domain** (in `PUBLIC SCHEMA > _sc_tenants`), rather than in the tenant's own `_sc_tenants` table.

If the same logic applies to other routes, a tenant admin effectively gains admin rights on the root domain.

## PoC

A tenant-created subtenant appears under the Saltcorn public schema instead of the tenant's own schema.

- Even when `role_id=1` is required for tenant creation on saltcorn.com (only admin can create tenants), existing tenant admins can still create new tenants because their local `role_id:1` is evaluated against the root domain.
- Even when `role_to_create_tenant` is set to `0` in the tenant's `_sc_config` schema, or removed entirely, the tenant admin can still create sub-tenants on the root domain — suggesting `role_to_create_tenant` is not being read at all.

## Impact

Tenant admins gain unauthorized admin-level access to the root domain. Any authenticated tenant admin can perform privileged operations (e.g., creating tenants) on the root domain by exploiting the role context mismatch.

## Which versions are affected by GHSA-9237-rg5p-rhfw?

6 open source packages ship an affected version, including @saltcorn/data.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@saltcorn/data` | npm | All versions | 1.4.4 |
| `@saltcorn/data` | npm | All versions | 1.4.4 |
| `@saltcorn/data` | npm | From 1.5.0-beta.0 | 1.5.2 |
| `@saltcorn/data` | npm | From 1.5.0-beta.0 | 1.5.2 |
| `@saltcorn/data` | npm | From 1.6.0-alpha.0 | 1.6.0-beta.2 |
| `@saltcorn/data` | npm | From 1.6.0-alpha.0 | 1.6.0-beta.2 |

## How do I fix GHSA-9237-rg5p-rhfw?

Upgrade @saltcorn/data to a fixed version for your release line: 1.4.4, 1.5.2 or 1.6.0-beta.2.

## Is GHSA-9237-rg5p-rhfw being exploited?

There is no known exploitation of GHSA-9237-rg5p-rhfw in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-9237-rg5p-rhfw and fix it if it is affected.

What it is: GHSA-9237-rg5p-rhfw is a vulnerability in @saltcorn/data, published on 22 Apr 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-9237-rg5p-rhfw in the wild and no public exploit code.

Affected packages and fixed versions:
- @saltcorn/data (npm): affected all versions; fixed in 1.4.4
- @saltcorn/data (npm): affected all versions; fixed in 1.4.4
- @saltcorn/data (npm): affected from 1.5.0-beta.0; fixed in 1.5.2
- @saltcorn/data (npm): affected from 1.5.0-beta.0; fixed in 1.5.2
- @saltcorn/data (npm): affected from 1.6.0-alpha.0; fixed in 1.6.0-beta.2
- @saltcorn/data (npm): affected from 1.6.0-alpha.0; fixed in 1.6.0-beta.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-9237-rg5p-rhfw/ (Markdown: https://insights.sbomify.com/GHSA-9237-rg5p-rhfw/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-9237-rg5p-rhfw

---
From sbomify Insights: https://insights.sbomify.com/GHSA-9237-rg5p-rhfw/
Summaries are generated and may contain mistakes; the official description above is the record.
