CVE-2021-25927: Prototype Pollution in safe-flat

safe-flat Updated 02 Oct 2025

Summary

21/06/2021
Yes i
Critical
9.8

CVE-2021-25927: Prototype pollution in safe-flat. Affects safe-flat versions >= 2.0.0, < 2.0.2. Fixed in 2.0.2. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The 'safe-flat' package is an npm package that provides a safe alternative to the 'flat' package for flattening nested arrays. It is commonly used in JavaScript applications to simplify array manipulation. However, versions 2.0.0 through 2.0.1 of 'safe-flat' are vulnerable to prototype pollution.

Vulnerability Detail

The vulnerability in 'safe-flat' versions 2.0.0 through 2.0.1 is due to prototype pollution. An attacker can exploit this vulnerability to cause a denial of service and potentially execute remote code. By manipulating the prototype of objects, an attacker can modify or add properties that may lead to unexpected behavior or security issues.

How To Fix

Minimum fixed version

2.0.2

This is the first release that contains the fix.

npm install safe-flat@2.0.2

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

Workaround

There is no known workaround for this vulnerability. It is crucial to update to the latest version of 'safe-flat' to mitigate the risk.

Conclusion

The 'safe-flat' package versions 2.0.0 through 2.0.1 are vulnerable to prototype pollution, which can result in a denial of service and potential remote code execution. It is crucial to update to version 2.0.2 or later to fix this vulnerability. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for safe-flat →

Share this vulnerability

FAQ

Prototype pollution is a vulnerability that occurs when an attacker can modify the prototype of objects, leading to unexpected behavior or security issues.

The vulnerability in 'safe-flat' can result in a denial of service and potentially remote code execution. This can lead to unauthorized access, data breaches, or other malicious activities.

If you are using 'safe-flat' versions 2.0.0 through 2.0.1, your application is vulnerable. It is recommended to upgrade to version 2.0.2 or later.

To update 'safe-flat' to the latest version, run the command 'npm install safe-flat@latest'. This will install the most recent version of the package.

There are no known workarounds for this vulnerability. It is essential to update to the latest version of 'safe-flat' to mitigate the risk.

How To Fix

Minimum fixed version

2.0.2

This is the first release that contains the fix.

npm install safe-flat@2.0.2

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