leptonlib - Stack-based Buffer Overflow and Command Injection Vulnerabilities

leptonlib Updated 02 Oct 2025

Summary

07/03/2018
N/A
Yes i
Unrated
Not published

DLA-1302-1: leptonlib - security update. Affects leptonlib versions < 1.69-3.1+deb7u2. Fixed in 1.69-3.1+deb7u2. 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 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

leptonlib is an image processing library used for various image manipulation tasks. It provides functions for image compression, decompression, and other image processing operations. The library is widely used in applications that deal with image processing and analysis. However, leptonlib is vulnerable to two security issues: a stack-based buffer overflow and a command injection vulnerability.

Vulnerability Detail

The stack-based buffer overflow vulnerability (CVE-2018-7186) in leptonlib is due to the library not properly limiting the number of characters in a %s format argument to fscanf or sscanf functions. This flaw can be exploited by remote attackers to cause a denial of service or potentially execute arbitrary code by providing a long string as input.

The command injection vulnerability (CVE-2018-7440) is a result of an incomplete fix for a previous vulnerability (CVE-2018-3836). The gplotMakeOutput function in leptonlib allows command injection via the gplot rootname argument using the $(command) approach. An attacker can exploit this vulnerability to execute arbitrary commands on the system.

How To Fix

Minimum fixed version

1.69-3.1+deb7u2

This is the first release that contains the fix.

sudo apt-get install --only-upgrade leptonlib

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

Workaround

There are no known workarounds for these vulnerabilities. It is crucial to apply the provided fix by upgrading to the patched version of leptonlib.

Conclusion

leptonlib, an image processing library, is affected by a stack-based buffer overflow vulnerability and a command injection vulnerability. These vulnerabilities can be exploited remotely and may lead to denial of service or arbitrary code execution. It is crucial to upgrade to leptonlib version 1.69-3.1+deb7u2 or later to mitigate these vulnerabilities. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for leptonlib →

Share this vulnerability

FAQ

The stack-based buffer overflow vulnerability in leptonlib can lead to a denial of service or potentially allow an attacker to execute arbitrary code on the affected system. By providing a long string as input, an attacker can overwrite the stack and potentially gain control over the program's execution.

The command injection vulnerability in leptonlib allows an attacker to execute arbitrary commands on the system by injecting them into the gplot rootname argument. By using the $(command) approach, an attacker can execute arbitrary commands with the privileges of the user running the vulnerable application.

At the time of this report, there are no known public exploits specifically targeting these vulnerabilities in leptonlib. However, it is important to apply the recommended fix to mitigate the risk of potential exploitation.

Yes, both the stack-based buffer overflow vulnerability and the command injection vulnerability can be exploited remotely. An attacker can send specially crafted input to the vulnerable application, triggering the vulnerabilities and potentially gaining control over the affected system.

For more information about these vulnerabilities, you can refer to the CVE identifiers: CVE-2018-7186 and CVE-2018-7440. Additionally, you can visit the Debian LTS security advisories page for detailed information on the fixes and their impact.

Related vulnerabilities

Recent vulnerabilities recorded for leptonlib.

How To Fix

Minimum fixed version

1.69-3.1+deb7u2

This is the first release that contains the fix.

sudo apt-get install --only-upgrade leptonlib

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