<Vulnerability name="CVE-2026-58459">
    <DocumentDistribution xml:lang="en">Copyright © 2012 Red Hat, Inc. All rights reserved.</DocumentDistribution>
    <ThreatSeverity>Important</ThreatSeverity>
    <PublicDate>2026-07-09T16:14:02</PublicDate>
    <Bugzilla id="2498575" url="https://bugzilla.redhat.com/show_bug.cgi?id=2498575" xml:lang="en:us">
gpsd: gpsd: Command Injection via GPS device subtype allows arbitrary code execution
    </Bugzilla>
    <CVSS3 status="draft">
        <CVSS3BaseScore>7.8</CVSS3BaseScore>
        <CVSS3ScoringVector>CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H</CVSS3ScoringVector>
    </CVSS3>
    <CWE>CWE-78</CWE>
    <Details xml:lang="en:us" source="Mitre">
gpsd through release-3.27.5, fixed at commit 4c06658, contains a command injection vulnerability in gpsprof that allows attackers who control the GPS device subtype value to execute arbitrary shell commands by embedding backtick payloads in the gnuplot plot title without proper escaping. The subtype field sourced from a DEVICES JSON log entry or NMEA PGRMT sentence is written into a generated gnuplot program via a set title statement with only double-quote characters escaped, enabling arbitrary shell command execution as the user running gnuplot when the victim renders the generated plot through the gpsprof and gnuplot workflow.
    </Details>
    <Details xml:lang="en:us" source="Red Hat">
A flaw was found in gpsd, a service application that monitors one or more GPSes or AIS receivers. The gpsprof utility is vulnerable to a command injection. An attacker who can control the GPS device subtype value can embed malicious commands within the gnuplot plot title. When a user processes a specially crafted plot through gpsprof and gnuplot, these embedded commands can be executed, leading to arbitrary code execution on the system.
    </Details>
    <Statement xml:lang="en:us">
An attacker can embed malicious commands within the gnuplot plot title by controlling the GPS device subtype value. When a user processes a specially crafted plot through `gpsprof`, these commands execute, leading to arbitrary code execution. Exploitation requires user interaction.
    </Statement>
    <PackageState cpe="cpe:/o:redhat:enterprise_linux:10">
        <ProductName>Red Hat Enterprise Linux 10</ProductName>
        <FixState>Affected</FixState>
        <PackageName>gpsd</PackageName>
    </PackageState>
    <PackageState cpe="cpe:/o:redhat:enterprise_linux:9">
        <ProductName>Red Hat Enterprise Linux 9</ProductName>
        <FixState>Affected</FixState>
        <PackageName>gpsd-minimal</PackageName>
    </PackageState>
    <References xml:lang="en:us">
https://www.cve.org/CVERecord?id=CVE-2026-58459
https://nvd.nist.gov/vuln/detail/CVE-2026-58459
https://github.com/ntpsec/gpsd/commit/1a6bb7bcbdf58aa940132e630870af061dc88537
https://github.com/ntpsec/gpsd/commit/4c06658e988f4ced1a7a574ce082a22ef625df56
https://github.com/ntpsec/gpsd/commit/5581ba196d826a984fbfaf792b7d58535f9911ce
https://gitlab.com/gpsd/gpsd/-/work_items/404#note_3534119267
https://www.vulncheck.com/advisories/gpsd-gpsprof-command-injection-via-gnuplot-plot-title-subtype-field
    </References>
</Vulnerability>