CVE-2020-28429: Command Injection in geojson2kml
Summary
CVE-2020-28429: Command Injection in geojson2kml. Affects geojson2kml versions < 0.1.1. No fix is published. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
geojson2kml is an npm package that converts GeoJSON files to KML format. It provides a simple and convenient way to convert geographic data for use in various applications. However, versions up to and including 0.1.1 of the package are vulnerable to Command Injection through the index.js file.
Vulnerability Detail
The Command Injection vulnerability in geojson2kml allows an attacker to execute arbitrary commands on the system where the package is installed. By manipulating user-supplied input, an attacker can inject malicious commands that are executed within the context of the application. This can lead to unauthorized access, data leakage, or even complete compromise of the affected system.
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 sanitize and validate user-supplied input before passing it to the geojson2kml package. This can help prevent the injection of malicious commands. Here is an example of how to sanitize the input in JavaScript:
const { exec } = require('child_process');
function sanitizeInput(input) {
// Remove any potentially dangerous characters
const sanitizedInput = input.replace(/[&|;$%@"'<>]/g, '');
return sanitizedInput;
}
const userInput = sanitizeInput(userSuppliedInput);
exec(`geojson2kml ./${userInput}`, (error, stdout, stderr) => {
// Handle the command execution result
});
Conclusion
The Command Injection vulnerability in geojson2kml can have severe consequences, including unauthorized access and data compromise. It is crucial to update to a patched version of the package and implement input sanitization to mitigate the risk. For further assistance in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for geojson2kml →
FAQ
geojson2kml is an npm package that converts GeoJSON files to KML format. It is commonly used in geographic data processing and visualization applications.
All versions up to and including 0.1.1 of geojson2kml are vulnerable to Command Injection.
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 context.
The Command Injection vulnerability in geojson2kml can lead to unauthorized access, data leakage, or complete compromise of the affected system.
To protect your application, it is recommended to upgrade to a version of geojson2kml that is not affected by this vulnerability. Additionally, sanitize and validate user-supplied input before passing it to the geojson2kml package.