VAITP Dataset

← Back to the dataset

CVE-2026-130161

Authenticated SSRF via DNS rebinding in recipe‑autofill URL feature.

  • CVSS 5.3
  • CWE-918
  • Input Validation and Sanitization
  • Remote

Tamari is a fully-featured recipe manager web application built using Python and the Flask Framework. Prior to 1.7.2, an authenticated user can bypass the recipe-autofill SSRF check by submitting a hostname under the user's control through the Autofill from URL feature; the hostname can resolve to a public address during validation and a private or internal address during the later connection. In app/myrecipes/routes.py, is_safe_autofill_url validates the first DNS response, but recipe autofill passes the original URL to requests.get, which independently resolves the hostname and can connect to the internal address. The fetched response is parsed into recipe fields, enabling internal-service reconnaissance and potential data exposure; no redirect is required, and disabling redirects does not stop this DNS-rebinding bypass. This issue is fixed in 1.7.2.

CVSS base score
5.3
Published
2026-11-19
OWASP
A10 Server-Side Request Forgery (SSRF)
Orthogonal defect classification
Checking
Code defect classification
Incorrect Check
Category
Input Validation and Sanitization
Subcategory
Insecure Parsing or Deserialization
Accessibility scope
Remote
Impact
Information Disclosure
Affected component
Flask

Solution

Upgrade Tamari to version 1.7.2 or later, which patches the SSRF bypass.

Vulnerable code sample

import re
import socket
import requests
from flask import Blueprint, request, abort, jsonify

myrecipes = Blueprint('myrecipes', __name__)

PRIVATE_NETS = [
    re.compile(r'^10\.'),
    re.compile(r'^192\.168\.'),
    re.compile(r'^172\.(1[6-9]|2[0-9]|3[0-1])\.')
]

def is_safe_autofill_url(url: str) -> bool:
    try:
        hostname = re.sub(r'^https?://', '', url).split('/')[0]
        ip = socket.getaddrinfo(hostname, None)[0][4][0]
        for net in PRIVATE_NETS:
            if net.match(ip):
                return False
        return True
    except Exception:
        return False

@myrecipes.route('/autofill', methods=['POST'])
def autofill():
    data = request.get_json()
    url = data.get('url')
    if not url or not is_safe_autofill_url(url):
        abort(400, 'Invalid URL')
    # VULNERABLE: uses original URL which may resolve to a private address later
    resp = requests.get(url, timeout=5)
    if resp.status_code != 200:
        abort(502, 'Failed to fetch recipe')
    recipe = resp.json()
    return jsonify(recipe)

Patched code sample

import re
import socket
import requests
from flask import Blueprint, request, abort, jsonify

myrecipes = Blueprint('myrecipes', __name__)

PRIVATE_NETS = [
    re.compile(r'^10\.'),
    re.compile(r'^192\.168\.'),
    re.compile(r'^172\.(1[6-9]|2[0-9]|3[0-1])\.')
]

def is_safe_autofill_url(url: str) -> bool:
    try:
        hostname = re.sub(r'^https?://', '', url).split('/')[0]
        ip = socket.getaddrinfo(hostname, None)[0][4][0]
        for net in PRIVATE_NETS:
            if net.match(ip):
                return False
        return True
    except Exception:
        return False

@myrecipes.route('/autofill', methods=['POST'])
def autofill():
    data = request.get_json()
    url = data.get('url')
    if not url or not is_safe_autofill_url(url):
        abort(400, 'Invalid URL')
    # FIX: resolve hostname again and ensure it matches the safe address before fetching
    hostname = re.sub(r'^https?://', '', url).split('/')[0]
    safe_ip = socket.getaddrinfo(hostname, None)[0][4][0]
    for net in PRIVATE_NETS:
        if net.match(safe_ip):
            abort(400, 'URL resolves to private address')
    resp = requests.get(url, timeout=5)
    if resp.status_code != 200:
        abort(502, 'Failed to fetch recipe')
    recipe = resp.json()
    return jsonify(recipe)

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

Cite this entry

@misc{vaitp:cve2026130161,
  title        = {{Authenticated SSRF via DNS rebinding in recipe‑autofill URL feature.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-130161},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-130161/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.