Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-59962 Overview
CVE-2026-59962 is an information disclosure vulnerability in Tandoor Recipes, an open-source application for managing recipes, meal planning, and shopping lists. Versions prior to 2.6.10 pass unvalidated sort_order and order_field strings into Django ORM order_by() calls. Authenticated users can supply foreign-key traversal paths through recipe search, RecipeBook, and stored CustomFilter ordering values. Django interprets double-underscore ordering fields as related-table traversal, and the observable result order leaks values from related User fields. This classifies as an injection weakness tracked under [CWE-943]. The issue is fixed in version 2.6.10.
Critical Impact
An authenticated attacker can infer sensitive data from related database tables, including password hashes, email addresses, and administrator status, by observing changes in result ordering.
Affected Products
- Tandoor Recipes versions prior to 2.6.10
- Recipe search endpoint at 8080/api/recipe/
- RecipeBook endpoint at 8080/api/recipe-book/
Discovery Timeline
- 2026-10-16 - CVE CVE-2026-59962 published to NVD
- 2026-10-16 - Last updated in NVD database
Technical Details for CVE-2026-59962
Vulnerability Analysis
Tandoor Recipes exposes user-controlled ordering parameters directly to Django ORM query construction. The _finalize_ordering function in cookbook/helper/recipe_search.py and the get_queryset method in cookbook/views/api.py accept arbitrary strings and pass them into order_by() without validation. Django treats double-underscore syntax such as created_by__password as a related-table field traversal. An attacker iterates candidate values and observes the returned result sequence to infer the underlying column data one character at a time.
This is a blind, oracle-based information disclosure. The response body does not contain the sensitive field, but the row ordering acts as a side channel. Repeated queries allow full extraction of password hashes, email addresses, and is_superuser flags from the Django auth_user table.
Root Cause
The root cause is missing allowlist validation on ordering parameters. The pre-patch code accepted any string key and appended it directly to the ORM ordering clause. Because Django ORM intentionally supports relationship traversal through ordering fields, any user-supplied string becomes a potential query path across the entire related object graph.
Attack Vector
Exploitation requires an authenticated account and network access to the API. The attacker sends crafted requests to recipe search, recipe-book, or CustomFilter endpoints with ordering values that traverse foreign keys into the User model, then compares result ordering across requests to infer stored values.
# Pre-patch vulnerable logic in cookbook/helper/recipe_search.py
def _finalize_ordering(orderby):
result = []
for key in orderby:
if not isinstance(key, str):
result.append(key)
elif key == 'name':
result.append(Lower('name').asc())
elif key == '-name':
result.append(Lower('name').desc())
elif key.lstrip('-') in _NULLS_LAST:
bare = key.lstrip('-')
expr = F(bare).desc(nulls_last=True) if key.startswith('-') else F(bare).asc(nulls_last=True)
result.append(expr)
else:
result.append(key) # Unvalidated user input passed to order_by()
Source: GitHub Commit 322696f6
Detection Methods for CVE-2026-59962
Indicators of Compromise
- Requests to /api/recipe/ or /api/recipe-book/ containing order_field or sort_order parameters with double-underscore syntax such as created_by__password or space__created_by__email.
- High-volume, repetitive query patterns from a single authenticated session targeting the same endpoint with incrementally changing ordering values.
- Stored CustomFilter records with ordering fields that reference related-model traversal paths.
Detection Strategies
- Inspect web server and application logs for query strings containing __ sequences in ordering parameters that do not match the fixed allowlist (id, name, order, random, score, lastcooked, rating, times_cooked, created_at, lastviewed, recent).
- Correlate authenticated session identifiers against request frequency to the recipe and recipe-book endpoints to surface oracle-style enumeration.
- Review the CustomFilter database table for stored ordering values that reference user or system model fields.
Monitoring Recommendations
- Enable verbose logging of ORM query generation in staging and audit for unexpected JOINs against the auth_user table.
- Alert on authenticated accounts generating more than a baseline threshold of ordered API requests per minute.
- Monitor for sudden growth in slow-query logs tied to the recipe search endpoints.
How to Mitigate CVE-2026-59962
Immediate Actions Required
- Upgrade Tandoor Recipes to version 2.6.10 or later immediately.
- Audit the CustomFilter table and remove any entries containing double-underscore ordering values that traverse related models.
- Rotate credentials and session tokens for all users if exposure is suspected, given the risk of leaked password hashes.
Patch Information
The fix is included in Tandoor Recipes release 2.6.10. The patch introduces strict allowlists for both the _finalize_ordering helper and the get_queryset method so only known-good ordering keys reach Django's order_by(). See the GHSA-4x57-2q4q-xwpp advisory and follow-up commits 322696f6, 382a976c, and 82fd4e00.
Workarounds
- If immediate patching is not possible, restrict network access to the Tandoor Recipes API to trusted users only.
- Place a reverse proxy or WAF rule in front of the application that drops requests where order_field or sort_order contains double underscores or values outside the known allowlist.
- Disable user-stored CustomFilter ordering until the upgrade is applied.
# Patched allowlist enforcement in cookbook/views/api.py (version 2.6.10)
def get_queryset(self):
ALLOWED_ORDER_FIELDS = ['id', 'name', 'order']
order_field = self.request.GET.get('order_field')
order_direction = self.request.GET.get('order_direction')
if not order_field or order_field.lower() not in ALLOWED_ORDER_FIELDS:
order_field = 'order'
primary_ordering = f"{'-' if order_direction == 'desc' else ''}{order_field}"
Source: GitHub Commit 82fd4e00
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

