CVE-2022-1291: Cross-site Scripting in tableexport.jquery.plugin

tableexport.jquery.plugin Updated 02 Oct 2025

Summary

11/04/2022
Yes i
Moderate
5.4

CVE-2022-1291: Cross-site Scripting in tableexport.jquery.plugin. Affects tableexport.jquery.plugin versions < 1.25.0. Fixed in 1.25.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The tableexport.jquery.plugin is an npm package that provides functionality for exporting HTML tables to various formats such as CSV, Excel, and PDF. It is widely used in web applications to enable users to download table data in different file formats. However, prior to version 1.25.0, the package is vulnerable to a cross-site scripting (XSS) attack.

Vulnerability Detail

The vulnerability in tableexport.jquery.plugin is due to a cross-site scripting vulnerability in the default onCellHtmlData function. This function is responsible for generating the HTML content of each table cell during the export process. An attacker can exploit this vulnerability by injecting malicious code into the table cells, which will be executed when the exported file is opened. This can lead to various consequences, such as transmitting cookies to third-party servers or sending data from secure sessions to unauthorized parties.

How To Fix

Minimum fixed version

1.25.0

This is the first release that contains the fix.

npm install tableexport.jquery.plugin@1.25.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, developers can implement their own onCellHtmlData function that sanitizes the content of each table cell before exporting. This can be done by using a library or function that removes or escapes any potentially malicious HTML or JavaScript code. Here is an example of a workaround using the DOMPurify library:

import DOMPurify from 'dompurify';

function sanitizeCellData(cellData) {
  return DOMPurify.sanitize(cellData);
}

// Usage:
const tableExportOptions = {
  onCellHtmlData: (cell, rowIndex, columnIndex) => {
    const cellData = cell.textContent;
    const sanitizedData = sanitizeCellData(cellData);
    return sanitizedData;
  },
};

Conclusion

In conclusion, the tableexport.jquery.plugin package prior to version 1.25.0 is vulnerable to a cross-site scripting (XSS) attack. This can lead to the execution of arbitrary JavaScript code in the user's browser, potentially compromising sensitive information or performing unauthorized actions. It is crucial to update to version 1.25.0 or later and properly sanitize user-generated content to mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tableexport.jquery.plugin →

Share this vulnerability

FAQ

tableexport.jquery.plugin is an npm package that allows developers to export HTML tables to various file formats such as CSV, Excel, and PDF.

This vulnerability allows an attacker to execute arbitrary JavaScript code in the context of the user's browser, potentially leading to unauthorized access to sensitive information or performing actions on behalf of the user.

You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply provide the package-lock.json file of your application, and Vulert will analyze it for any known vulnerabilities, including CVE-2022-1291.

Yes, the vulnerability has been fixed in version 1.25.0 of the tableexport.jquery.plugin package. It is recommended to update to this version or later to mitigate the risk.

To protect your application, make sure to update the tableexport.jquery.plugin package to version 1.25.0 or later. Additionally, sanitize and validate any user-generated content before displaying it in table cells or any other part of your application.

How To Fix

Minimum fixed version

1.25.0

This is the first release that contains the fix.

npm install tableexport.jquery.plugin@1.25.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback