{"id":1628,"cve":"CVE-2026-27469","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2026-27469\/","cwe":"CWE-79","cwe_number":79,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/79","cvss_score":6.1,"published":"2026-02-21","owasp":"A03 Injection","odc":"Checking","cdc":"Incorrect Check","category":"Input Validation and Sanitization","subcategory":"Cross-Site Scripting (XSS)","scope":"Remote","impact":"Arbitrary Code Execution","summary":"Isso is vulnerable to stored XSS in comment fields via improper escaping.","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2026-27469\/","description":"Isso is a lightweight commenting server written in Python and JavaScript. In commits before 0afbfe0691ee237963e8fb0b2ee01c9e55ca2144, there is a stored Cross-Site Scripting (XSS) vulnerability affecting the website and author comment fields. The website field was HTML-escaped using quote=False, which left single and double quotes unescaped. Since the frontend inserts the website value directly into a single-quoted href attribute via string concatenation, a single quote in the URL breaks out of the attribute context, allowing injection of arbitrary event handlers (e.g. onmouseover, onclick). The same escaping is missing entirely from the user-facing comment edit endpoint (PUT \/id\/) and the moderation edit endpoint (POST \/id\/\/edit\/). This issue has been patched in commit 0afbfe0691ee237963e8fb0b2ee01c9e55ca2144. To workaround, nabling comment moderation (moderation = enabled = true in isso.cfg) prevents unauthenticated users from publishing comments, raising the bar for exploitation, but it does not fully mitigate the issue since a moderator activating a malicious comment would still expose visitors.","solution":"Upgrade Isso to version 0.12.5 or later.","affected_component":"Isso","fixed_by_upgrading":true,"vulnerable_code":"import html\n\ndef create_comment_vulnerable(data):\n    \"\"\"\n    This function simulates the vulnerable comment creation logic from Isso\n    before the patch for CVE-2026-27469.\n\n    The 'website' field is processed with html.escape(..., quote=False).\n    This flaw fails to escape single or double quotes, creating a stored XSS\n    vulnerability when the value is later rendered inside an HTML attribute.\n    \"\"\"\n    # The text and author fields are assumed to be handled separately.\n    text = html.escape(data.get('text', ''))\n    author = html.escape(data.get('author', ''))\n\n    # VULNERABLE LINE: The `quote=False` parameter prevents the escaping of\n    # single (') and double (\") quotes in the 'website' field.\n    # An attacker can submit a payload like:\n    # https:\/\/example.com' onmouseover='alert(\"XSS\")'\n    website = html.escape(data.get('website', ''), quote=False)\n\n    # The processed data would then be stored in the database.\n    return {\n        'text': text,\n        'author': author,\n        'website': website\n    }\n\ndef update_comment_vulnerable(data):\n    \"\"\"\n    This function simulates the vulnerable comment editing endpoint (e.g., PUT \/id\/).\n    The CVE notes that HTML escaping was missing entirely from this endpoint for\n    certain fields, allowing for direct injection of malicious HTML.\n    \"\"\"\n    # VULNERABLE: 'author' and 'website' are taken directly from user input\n    # without any HTML escaping. An attacker can set the website to a value like:\n    # javascript:alert('XSS')\n    # Or inject event handlers by breaking out of attributes during rendering.\n    author = data.get('author')\n    website = data.get('website')\n    text = html.escape(data.get('text', '')) # Text field might be handled correctly.\n\n    # The unescaped data would be saved directly to the database,\n    # to be rendered later for other users.\n    return {\n        'text': text,\n        'author': author,\n        'website': website\n    }\n\n\ndef render_vulnerable_comment(comment):\n    \"\"\"\n    Simulates how a frontend template would render the comment.\n    The 'website' value is concatenated directly into a single-quoted HTML attribute.\n    \"\"\"\n    # When rendering, the unescaped single quote from an attacker's payload\n    # breaks out of the `href` attribute, allowing arbitrary attribute injection.\n    # For example, a stored 'website' value of:\n    #   https:\/\/example.com' onmouseover='alert(1)' class='injected\n    # would result in the following broken and malicious HTML:\n    #   <a href='https:\/\/example.com' onmouseover='alert(1)' class='injected'>\n    author_link = f\"<a href='{comment['website']}' rel='nofollow'>{comment['author']}<\/a>\"\n\n    return f\"\"\"\n    <div class=\"comment-author\">{author_link}<\/div>\n    <div class=\"comment-text\">{comment['text']}<\/div>\n    \"\"\"","patched_code":"import markupsafe\n\ndef fixed_comment_serialization(comment_data):\n    \"\"\"\n    This function demonstrates the logic that fixes the Stored XSS vulnerability\n    (originally identified as CVE-2021-28469) in Isso.\n\n    The vulnerability was caused by improperly escaping the 'website' field\n    using a call equivalent to `markupsafe.escape(..., quote=False)`.\n    This setting does not escape single or double quotes. Since the frontend\n    injected the 'website' URL into a single-quoted href attribute (e.g.,\n    <a href='...'>), an attacker could provide a URL containing a single quote\n    to break out of the attribute and inject malicious event handlers.\n\n    For example, a malicious URL like:\n    https:\/\/example.com' onmouseover='alert(\\\"XSS\\\")'\n\n    ...would result in the following vulnerable HTML:\n    <a href='https:\/\/example.com' onmouseover='alert(\\\"XSS\\\")'>\n\n    The fix, represented below, is to ensure that all user-provided string fields,\n    especially 'website', are escaped using the default, secure behavior of\n    `markupsafe.escape()`. The default setting (`quote=True`) correctly converts\n    special characters like ' and \" into their corresponding HTML entities\n    (&#39; and &#34;), neutralizing the XSS payload.\n\n    Args:\n        comment_data (dict): A dictionary containing raw comment fields like\n                             'text', 'author', and 'website'.\n\n    Returns:\n        dict: The comment data with fields properly escaped to prevent XSS.\n    \"\"\"\n    sanitized_data = {}\n\n    # The patched code applies strong, default escaping to all relevant fields.\n    # This logic was applied in the places where comment data is prepared for\n    # JSON responses to the client.\n    for field in [\"author\", \"website\", \"text\"]:\n        if field in comment_data and comment_data[field]:\n            # The fix is to use markupsafe.escape() with its default `quote=True`.\n            # This correctly escapes single quotes ('), double quotes (\"),\n            # ampersands (&), and angle brackets (<, >).\n            sanitized_data[field] = markupsafe.escape(comment_data[field])\n        else:\n            sanitized_data[field] = comment_data.get(field)\n\n    return sanitized_data\n\n# --- Example demonstrating the effect of the fix ---\n\n# Malicious payload designed to break out of a single-quoted HTML attribute.\nmalicious_payload = {\n    \"author\": \"Attacker\",\n    \"website\": \"https:\/\/example.com' onmouseover='alert(\\\"XSS\\\")' data-dummy='\",\n    \"text\": \"<script>alert('XSS')<\/script>\"\n}\n\n# Apply the fixed serialization logic to the malicious payload.\nsafe_data = fixed_comment_serialization(malicious_payload)\n\n# The resulting 'safe_data' dictionary now contains neutralized strings\n# that are safe to render in an HTML context.\n#\n# print(safe_data)\n#\n# Expected output from the print statement:\n# {\n#     'author': 'Attacker',\n#     'website': 'https:\/\/example.com&#39; onmouseover=&#39;alert(&#34;XSS&#34;)&#39; data-dummy=&#39;',\n#     'text': '&lt;script&gt;alert(&#39;XSS&#39;)&lt;\/script&gt;'\n# }\n#\n# As shown in the expected output, the single and double quotes in the 'website'\n# field are converted to HTML entities, preventing the browser from interpreting\n# them as closing delimiters for the href attribute or as part of a new attribute.","payload_needed":true,"payload":"```\n' onmouseover='alert(\"XSS\")'\n```","payload_status":"available","published_fix":[{"repository":"isso-comments\/isso","commit_url":"https:\/\/github.com\/isso-comments\/isso\/commit\/0afbfe0691ee237963e8fb0b2ee01c9e55ca2144","commit_subject":"Fix stored XSS in website and author fields","units":[{"file":"isso\/views\/comments.py","function":"API.edit"},{"file":"isso\/views\/comments.py","function":"API.moderate"},{"file":"isso\/views\/comments.py","function":"API.new"}]}],"references":null}