CVE-2021-23654: Improper Neutralization of Formula Elements in a CSV File in html-2-csv

html-to-csv Updated 02 Oct 2025

Summary

30/11/2021
No i
Moderate
5.6

CVE-2021-23654: Improper Neutralization of Formula Elements in a CSV File in html-2-csv. Affects html-to-csv versions < 0.1.3. No fix is published. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The html-to-csv package is an open-source Python package available on PyPI. It provides functionality to convert HTML pages into CSV files. This package is commonly used for data extraction and manipulation tasks. However, all versions of the package are vulnerable to an improper neutralization of formula elements in a CSV file. This vulnerability allows a malicious actor to embed or generate a malicious link or execute commands via CSV files.

Vulnerability Detail

The vulnerability in html-to-csv arises from the lack of validation when processing HTML pages with embedded formulas. When converting the HTML page into a CSV file, the formula elements are accepted without proper scrutiny. This allows an attacker to inject malicious links or execute arbitrary commands through the CSV file. The impact of this vulnerability can range from unauthorized access to sensitive data to remote code execution on the target system. The Common Vulnerability Scoring System (CVSS) score for this vulnerability is 5.6.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, users can manually validate and sanitize the HTML pages before converting them to CSV files. This can be done by implementing custom validation and sanitization logic to ensure that only trusted and safe content is processed. Here's an example of how this can be achieved using the BeautifulSoup library in Python:

from bs4 import BeautifulSoup

def sanitize_html(html):
    soup = BeautifulSoup(html, 'html.parser')
    # Implement custom validation and sanitization logic
    # ... (code omitted for brevity)
    return str(soup)

By applying this workaround, users can mitigate the risk of processing malicious HTML pages.

Conclusion

In conclusion, the html-to-csv package is vulnerable to an improper neutralization of formula elements in CSV files. This vulnerability allows attackers to embed malicious links or execute arbitrary commands. To mitigate this risk, it is crucial to update the package to a non-vulnerable version (0.1.4 or later). Additionally, implementing custom validation and sanitization logic can serve as a temporary workaround. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for html-to-csv →

Share this vulnerability

FAQ

The impact of this vulnerability can range from unauthorized access to sensitive data to remote code execution on the target system. An attacker can embed or generate malicious links or execute arbitrary commands through CSV files.

To fix this vulnerability, update the html-to-csv package to a non-vulnerable version (0.1.4 or later). Modify the package version in the project's dependency file and install the updated version using the package manager.

Yes, all versions of the html-to-csv package are affected by this vulnerability. It is recommended to update to a non-vulnerable version (0.1.4 or later).

Yes, as a temporary workaround, users can manually validate and sanitize the HTML pages before converting them to CSV files. Implement custom validation and sanitization logic to ensure only trusted and safe content is processed.

The CVSS score for this vulnerability is 5.6, indicating a moderate severity level.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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