Debian LinuxOperating system · Debian

CVE-2018-7440

CRITICAL · 9.8 CVSS v3.0 Published 2018-02-23
Fix available
A fix is available. Upgrade to after 1.75.3 or later.
See remediation →
100/100
Remediation priority · Urgent
Remotely reachable No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
An issue was discovered in Leptonica through 1.75.3. The gplotMakeOutput function allows command injection via a $(command) approach in the gplot rootname argument. This issue exists because of an incomplete fix for CVE-2018-3836.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

Leptonica through 1.75.3 contains a command injection vulnerability in the gplotMakeOutput function. The function uses the gplot rootname argument in shell commands without proper sanitization, allowing arbitrary command execution via $(command) substitution. This represents an incomplete fix for the earlier CVE-2018-3836, indicating the original remediation did not adequately address all command injection vectors.

MitigationUpdate Leptonica to a version beyond 1.75.3 that includes complete remediation for this vulnerability, or implement strict input validation on the gplot rootname argument to reject any shell metacharacters before passing to gplotMakeOutput.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
Debian LinuxOperating system
Affected:= 7.0
LeptonicaApplication
Affected:<= 1.75.3

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify installed Leptonica version
    On Linux systems, run 'pkg-config --modversion leptonica' or check the library file with 'ldconfig -p | grep lept' then 'strings <library_path> | grep -i leptonica' to find version info. On Debian, run 'dpkg -l | grep leptonica'. Compare the version number to the affected range (<=1.75.3).
    Affected if The installed Leptonica version is 1.75.3 or lower.
  2. Locate code using gplotMakeOutput function
    Search source code repositories or deployed binaries for calls to 'gplotMakeOutput' function. Use grep -r 'gplotMakeOutput' on source directories or examine binary symbols with 'nm' or 'objdump' if the library is linked statically.
    Affected if Code directly invokes the gplotMakeOutput function.
  3. Inspect gplot rootname argument handling
    Examine the source code or decompiled binary logic that passes the rootname parameter to gplotMakeOutput. Look for whether the rootname value is derived from user input, file names from uploaded content, or other untrusted sources without validation.
    Affected if The rootname argument can be controlled by external user input without sanitization of shell metacharacters like $() or backticks.
  4. Verify shell command construction in gplotMakeOutput
    If source code is available, review the gplotMakeOutput implementation in the Leptonica source to confirm that shell commands are constructed using the rootname value. Look for system(), popen(), or exec*() calls using the unsanitized rootname.
    Affected if The function constructs shell commands using the rootname parameter without escaping or input validation.

A user is affected if their Leptonica installation is version 1.75.3 or earlier AND their application passes untrusted input to the gplot rootname parameter of gplotMakeOutput.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to a release after 1.75.3
Interim mitigation

Update Leptonica to a version beyond 1.75.3 that includes complete remediation for this vulnerability, or implement strict input validation on the gplot rootname argument to reject any shell metacharacters before passing to gplotMakeOutput.

Recommended fix Moderate confidence

Leptonica 1.76.0 or later

  1. 1. Identify the currently installed Leptonica version using: dpkg -l | grep leptonica or ls -la /usr/include/leptonica/ for header files
  2. 2. Obtain the fixed version of Leptonica (version 1.76.0 or later) from the official GitHub repository: https://github.com/DanBloomberg/leptonica/releases
  3. 3. Download the source code for the fixed release
  4. 4. Remove the old Leptonica installation: sudo apt-get remove libleptonica-dev (on Debian-based systems)
  5. 5. Install the fixed version by compiling from source: ./configure, make, sudo make install
  6. 6. Verify the installation by checking the version and confirming the gplotMakeOutput function no longer accepts command substitution
Caveat Minimal risk - this is a security patch release; however, recompilation of any software linking against Leptonica may be required

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Debian Linux Scoped from the published advisory
  • Consultation4.0 h
  • Implementation4.0 h
  • Testing3.0 h
  • Review / QA2.0 h
13.0 hours of engineering $2,330
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,728.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2018-7440 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2018-7440 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data