CVE-2022-30284: Remote Command Execution in python-libnmap

python-libnmap Updated 02 Oct 2025

Summary

04/05/2022
Yes i
Critical
9.8

CVE-2022-30284: DISPUTED In the python-libnmap package through 0.7.2 for Python, remote command execution can occur (if used in a client application that does not validate arguments). Affects python-libnmap versions < 0.7.3. Fixed in 0.7.3. 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

python-libnmap is a Python library that provides a convenient interface to the Nmap security scanner. It allows users to programmatically execute Nmap scans and retrieve the results. The library is commonly used in client applications to perform network scanning and security assessments. However, in versions prior to 0.7.3, python-libnmap is vulnerable to remote command execution if used in a client application that does not properly validate input arguments.

Vulnerability Detail

The vulnerability (CVE-2022-30284) in python-libnmap arises from a lack of input validation in the NmapProcess function. If an application uses this function with arguments obtained from untrusted sources, an attacker can inject malicious commands and execute arbitrary code on the target system. This can lead to unauthorized access, data breaches, and potential compromise of the entire network. It is important to note that the vendor disputes the practicality of this scenario, as it would require using untrusted input from an untrusted network. However, the vulnerability exists and should be addressed to ensure the security of applications using python-libnmap.

How To Fix

Minimum fixed version

0.7.3

This is the first release that contains the fix.

pip install --upgrade "python-libnmap==0.7.3"

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

Workaround

As the vendor suggests, it is highly unlikely that an application would call NmapProcess with arguments obtained from untrusted sources over an untrusted network. However, if such a scenario is unavoidable, it is crucial to implement strict input validation and sanitization. All user-supplied arguments should be thoroughly validated and sanitized to prevent command injection. Additionally, network traffic should be encrypted and authenticated to minimize the risk of unauthorized access and tampering.

Conclusion

The vulnerability in python-libnmap (CVE-2022-30284) allows remote command execution, posing a significant security risk to applications utilizing this library. It is crucial to update to version 0.7.3 or later to fix the vulnerability. Additionally, implementing strict input validation and network security measures can further mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for python-libnmap →

Share this vulnerability

FAQ

python-libnmap is a Python library that provides an interface to the Nmap security scanner. It allows users to programmatically execute Nmap scans and retrieve the results.

The vulnerability allows remote command execution, which can lead to unauthorized access, data breaches, and potential compromise of the entire network.

If your application uses python-libnmap versions prior to 0.7.3, it is affected by this vulnerability. It is recommended to update to the latest version to mitigate the risk.

You can update python-libnmap by running the command 'pip install --upgrade python-libnmap'. Make sure to use version 0.7.3 or later.

While the vendor disputes the practicality of the vulnerability scenario, if you must use untrusted input from an untrusted network, ensure strict input validation and sanitization. Encrypt and authenticate network traffic to minimize risks.

Related vulnerabilities

Recent vulnerabilities recorded for python-libnmap.

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

Minimum fixed version

0.7.3

This is the first release that contains the fix.

pip install --upgrade "python-libnmap==0.7.3"

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