CVE-2021-23376: Command Injection in ffmpegdotjs

ffmpegdotjs Updated 02 Oct 2025

Summary

06/05/2021
No i
Critical
9.8

CVE-2021-23376: Command Injection in ffmpegdotjs. Affects ffmpegdotjs versions < 0.0.4. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

ffmpegdotjs is an npm package that provides a JavaScript interface for working with FFmpeg, a popular multimedia framework. It allows developers to manipulate and process audio and video files programmatically. The package is widely used in various applications and projects that require video editing or transcoding capabilities. However, all versions of ffmpegdotjs are vulnerable to a command injection attack when user-controlled input is passed to the trimvideo function. This vulnerability arises due to the lack of input sanitization in the usage of the child_process exec function.

Vulnerability Detail

The command injection vulnerability in ffmpegdotjs allows an attacker to execute arbitrary commands on the system where the vulnerable package is being used. By providing malicious input to the trimvideo function, an attacker can manipulate the command executed by the child_process exec function, leading to unauthorized command execution. This can result in various security risks, including remote code execution, data loss, or unauthorized access to sensitive information. The severity of this vulnerability is rated as CRITICAL with a CVSS score of 9.8.

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

If immediate package update is not feasible, a temporary workaround can be implemented by implementing strict input validation and sanitization within the application code. Before passing user input to the trimvideo function, ensure that it does not contain any malicious characters or commands. Use appropriate input validation techniques, such as whitelisting allowed characters or using regular expressions to match expected input patterns. Additionally, consider implementing a security middleware or library that automatically sanitizes user input to prevent command injection vulnerabilities.

Conclusion

The command injection vulnerability in ffmpegdotjs poses a significant security risk, allowing attackers to execute arbitrary commands on affected systems. It is crucial to update the package to a non-vulnerable version and implement proper input validation to prevent command injection attacks. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for ffmpegdotjs →

Share this vulnerability

FAQ

ffmpegdotjs is an npm package that provides a JavaScript interface for working with FFmpeg, a multimedia framework used for audio and video processing.

Command injection is a security vulnerability that allows an attacker to execute arbitrary commands on a system by injecting malicious input into a command execution function.

The vulnerability in ffmpegdotjs arises due to the lack of input sanitization in the trimvideo function, which allows user-controlled input to be directly passed to the child_process exec function without proper validation.

The command injection vulnerability in ffmpegdotjs can lead to various security risks, including remote code execution, unauthorized access to sensitive information, and data loss.

To mitigate the risk, it is recommended to update the ffmpegdotjs package to a non-vulnerable version and implement proper input validation and sanitization techniques when accepting user-controlled input.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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