PYSEC-2026-3702: tablib versions prior to 3.10.0 Stored XSS via HTML Export Dataset Title
tablib prior to 3.10.0 contains a stored cross-site scripting vulnerability in the HTML export functionality that allows attackers to execute arbitrary JavaScript by embedding malicious payloads in dataset titles, which are interpolated unsanitized into HTML output via the exportbook method in the html.py format handler. Attackers can rename worksheet sheets in imported files such as XLSX, ODS, XLS, or YAML with script payloads that are assigned to the Dataset title attribute and rendered unescaped inside an HTML h3 tag, leading to session hijacking, unauthorized administrative actions, and sensitive data exposure when the output is rendered in a browser.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
tablibto a version that resolves this vulnerability.Fixed in 3.10.0
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications using tablib versions earlier than 3.10.0 are exposed if they import attacker-influenced XLSX, ODS, XLS, or YAML data and render tablib HTML export output in a browser. The risk is especially relevant where imported worksheet or dataset titles can be controlled by untrusted users.
What must an attacker do to exploit it?
An attacker needs to supply an imported file whose worksheet or sheet name contains a JavaScript payload. That name is assigned to the Dataset title and is emitted without escaping in an HTML h3 element when the application exports the dataset to HTML.
Is user interaction required?
Yes. A user must render or view the generated HTML output in a browser for the embedded script to execute. The attacker does not need to rely on a complex exploitation condition beyond providing the malicious title and having the resulting export viewed.
What can be done if upgrading is not immediately possible?
Do not render HTML exports generated from untrusted imported files in a browser. As an interim control, validate or sanitize worksheet and dataset titles before HTML export so that HTML and script content cannot be included in the title.