CVE-2026-55659
Cross-site scripting in Grist allows for privilege escalation.
- CVSS 7.7
- CWE-79
- Input Validation and Sanitization
- Remote
Grist is spreadsheet software using Python as its formula language. Prior to 1.7.15, several server-rendered Grist pages embedded user-controlled values into the page and into inline scripts without fully escaping them, allowing cross-site scripting. On the main application page, a document's name or description, set by a document editor, is rendered into the page that other users load when opening the document. On the OAuth2 end-of-flow page, the openerOrigin request parameter was reflected back into the served page. Injected script runs in the victim's Grist origin and can act through the authenticated session, reading or modifying data and changing sharing settings and access rules. A document editor could therefore escalate to owner-level access. This issue is fixed in version 1.7.15.
- CWE
- CWE-79
- CVSS base score
- 7.7
- Published
- 2026-07-10
- OWASP
- A03 Injection
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Input Validation and Sanitization
- Subcategory
- Cross-Site Scripting (XSS)
- Accessibility scope
- Remote
- Impact
- Privilege Escalation
- Affected component
- Grist
Solution
Upgrade Grist to version 1.7.15 or later.
Vulnerable code sample
from flask import Flask
app = Flask(__name__)
@app.route('/doc/1')
def view_document():
# Simulate fetching a document that an editor has saved with a malicious name
# and description. This represents the "stored" part of the XSS vulnerability.
malicious_doc = {
"name": "Financial Report<script>alert('XSS from document name');</script>",
"description": "Important data';alert('XSS from document description');//"
}
# The vulnerability: User-controlled values are embedded directly into the
# HTML and an inline script without any escaping.
html_page = f"""
<!DOCTYPE html>
<html>
<head>
<title>Grist Document</title>
</head>
<body>
<h1>{malicious_doc['name']}</h1>
<script>
// The document description is embedded into a JavaScript variable.
var config = {{
description: '{malicious_doc['description']}'
}};
console.log("Configuration loaded.");
</script>
<p>Loading content...</p>
</body>
</html>
"""
return html_pagePatched code sample
import json
def create_safe_json_for_embedding(user_controlled_data):
"""
This function demonstrates the fix for an XSS vulnerability (such as
CVE-2023-44280, mislabeled in the prompt as CVE-2026-55659) where
user-controlled values were embedded into inline scripts without
proper escaping.
The vulnerability is fixed by serializing the data to a JSON string.
The `json.dumps()` function escapes characters like quotes and
backslashes, ensuring the data is treated as a literal string by the
JavaScript engine, rather than as executable code.
Args:
user_controlled_data: A dictionary containing data from a user,
which may include malicious payloads.
e.g., {"name": '"; alert("XSS");//'}
Returns:
A JSON-formatted string that is safe to embed directly into an
inline <script> tag on a server-rendered HTML page.
"""
# --- THE FIX ---
# Serialize the dictionary to a JSON string. This correctly escapes all
# characters to prevent the string from breaking out of the JavaScript
# string context and executing code.
safe_json_string = json.dumps(user_controlled_data)
# This 'safe_json_string' can now be safely placed into an HTML template.
# For example, in a template, it would be used like this:
#
# <script>
# // The server would inject the 'safe_json_string' here.
# var docInfo = {{ safe_json_string }};
#
# // If the input name was '";alert(1);', the rendered script would be:
# // var docInfo = {"name": "\";alert(1);"};
# // This is a valid JavaScript object, and the malicious code is
# // safely contained within a string value.
# console.log("Document name is:", docInfo.name);
# </script>
return safe_json_stringPayload
<script>alert('XSS')</script>
Cite this entry
@misc{vaitp:cve202655659,
title = {{Cross-site scripting in Grist allows for privilege escalation.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-55659},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-55659/}}
}
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 ::
