CVE-2018-7440
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 · uneditedAn 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 confidenceLeptonica 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.
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= 7.0<= 1.75.3CVSS 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 checksWork through these to decide whether this CVE applies to you.
-
Identify installed Leptonica versionOn 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.
-
Locate code using gplotMakeOutput functionSearch 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.
-
Inspect gplot rootname argument handlingExamine 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.
-
Verify shell command construction in gplotMakeOutputIf 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.
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 · scopedUpdate 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.
Leptonica 1.76.0 or later
- 1. Identify the currently installed Leptonica version using: dpkg -l | grep leptonica or ls -la /usr/include/leptonica/ for header files
- 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. Download the source code for the fixed release
- 4. Remove the old Leptonica installation: sudo apt-get remove libleptonica-dev (on Debian-based systems)
- 5. Install the fixed version by compiling from source: ./configure, make, sudo make install
- 6. Verify the installation by checking the version and confirming the gplotMakeOutput function no longer accepts command substitution
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation4.0 h
- Implementation4.0 h
- Testing3.0 h
- Review / QA2.0 h
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 locallyCheck 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 sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2018-7440 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
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.
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.
- 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