CVE-2021-40926: Cross-site scripting in getID3

james-heinrich/getid3 Updated 02 Oct 2025

Summary

04/10/2021
Yes i
Moderate
6.1

CVE-2021-40926: Cross-site scripting in demos/demo.mysqli.php in getID3. Affects james-heinrich/getid3 versions >= 1.0.0, < 1.9.21. Fixed in 1.9.21. How to fix ↓

Also tracked for

The same CVE-2021-40926 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

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

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 getID3 package is a PHP library that allows developers to extract metadata from various audio and video file formats. It provides functionality to analyze and retrieve information such as file type, duration, bitrate, and more. The package is widely used in PHP applications for media processing and analysis. However, versions 1.X and v2.0.0-beta of getID3 are vulnerable to a cross-site scripting (XSS) attack.

Vulnerability Detail

The vulnerability (CVE-2021-40926) in getID3 arises from a lack of proper input sanitization in the demos/demo.mysqli.php file. Remote attackers can exploit this vulnerability by injecting arbitrary web scripts or HTML through the 'showtagfiles' parameter. This can lead to the execution of malicious code in the context of the affected user's browser, potentially compromising their sensitive information or performing unauthorized actions on their behalf. The severity of this vulnerability is rated as MODERATE with a CVSS score of 6.1.

How To Fix

Minimum fixed version

1.9.21

This is the first release that contains the fix.

composer require james-heinrich/getid3:1.9.21

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

Workaround

As a temporary workaround, developers can manually sanitize the 'showtagfiles' parameter before using it in the affected file. Here is an example of how to sanitize the parameter using PHP's htmlspecialchars function:

$showtagfiles = htmlspecialchars($_GET['showtagfiles'], ENT_QUOTES, 'UTF-8');

Conclusion

The cross-site scripting vulnerability in getID3 (CVE-2021-40926) can be mitigated by updating to version 1.9.21 or later. Developers should also follow secure coding practices by validating and sanitizing user input to prevent similar vulnerabilities. For further assistance or support in addressing this vulnerability, please contact DevNack.com.

See every vulnerability recorded for james-heinrich/getid3 →

Share this vulnerability

FAQ

The vulnerability allows remote attackers to inject malicious scripts or HTML into the affected application, potentially leading to the execution of arbitrary code in the user's browser. This can result in various consequences, such as stealing sensitive information, performing unauthorized actions, or defacing the application's web pages.

Versions 1.X and v2.0.0-beta of getID3 are affected by this vulnerability.

At the time of this advisory, there are no known public exploits specifically targeting this vulnerability. However, it is crucial to apply the recommended fixes promptly to mitigate the risk of exploitation.

Yes, the CVSS score for this vulnerability is 6.1, indicating a moderate severity level.

For more information about the fix, including the specific code changes and release notes, refer to the official getID3 repository on GitHub.

Related vulnerabilities

Recent vulnerabilities recorded for james-heinrich/getid3.

How To Fix

Minimum fixed version

1.9.21

This is the first release that contains the fix.

composer require james-heinrich/getid3:1.9.21

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