Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions crates/postrust-core/RUSTSEC-0000-0000.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
```toml
[advisory]
id = "RUSTSEC-0000-0000"
package = "postrust-core"
date = "2026-10-30"
url = "https://github.com/postrust/postrust/commit/6a696ba521d03b5ad329fa50076b49e18926baaf"
references = ["https://github.com/postrust/postrust/security/advisories/GHSA-fcc3-v946-gfrr", "https://github.com/postrust/postrust/releases/tag/v2.4.1"]
categories = ["format-injection"]
keywords = ["sql-injection", "postgrest"]
aliases = ["GHSA-fcc3-v946-gfrr"]
cvss = "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"

[versions]
patched = [">= 2.4.1"]
unaffected = ["< 1.0.0-alpha.1"]
```

# SQL injection through the type name of a cast in `select`

The type name after `::` in a `select` cast (for example
`?select=price::text`) was written into the generated SQL statement as the
client sent it. The parser accepted spaces in that position, so any client --
including an anonymous one when an anonymous role is configured -- could append
SQL keywords and identifiers to the statement's SELECT list.

The injectable characters are limited to letters, digits, `_`, `$` and spaces,
so no second statement can be stacked, and the statement still runs as the
request's database role, under its grants and row-level security. No way to
read data the role could not read anyway has been found, but one is not ruled
out.

Version 2.4.1 parses a cast as a single type name (or one of the SQL
standard's multi-word type names, written in the standard's spelling) and
refuses anything else with 400 `PGRST100`. Upgrade `postrust-core` (and with it
`postrust-server` or `postrust-lambda`) to 2.4.1 or later; 3.0.0 is also fixed.
The Cloudflare Worker build, `postrust-worker`, is fixed in 1.0.1.
Loading