CVE Professor
/
All CVEs
CVE-2026-138214

CVE-2026-138214 — OSGeo Libgeotiff — CWE-119 · CWE-120

MEDIUM CVSS 6.3 Shodan

A security vulnerability has been detected in OSGeo libgeotiff up to 1.7.4. Affected by this vulnerability is the function cpStripToTile of the file bin/geotifcp.c of the component Copy Loop Handler. Such manipulation of the argument tile width/length/StripOffsets/StripByteCounts leads to buffer overflow. The attack can be launched remotely. The exploit has been disclosed publicly and may be used. The project was informed of the problem early through an issue report but has not responded yet.

A security vulnerability has been detected in OSGeo libgeotiff up to 1.7.4. Affected by this vulnerability is the function cpStripToTile of the file bin/geotifcp.c of the component Copy Loop Handler. Such manipulation of the argument tile width/length/StripOffsets/StripByteCounts leads to buffer overflow. The attack can be launched remotely. The exploit has been disclosed publicly and may be used. The project was informed of the problem early through an issue report but has not responded yet.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. None PR:N
User Interaction Required UI:R
Scope Unchanged S:U
Confidentiality Low C:L
Integrity Low I:L
Availability Low A:L
AI Security Analysis & Remediation

🎯 What is this vulnerability?

CVE-2026-138214 is a Buffer Overflow vulnerability (CWE-119/CWE-120) located in the libgeotiff library, specifically within the geotifcp utility.

Technical Flaw Analysis

The vulnerability resides in the function cpStripToTile inside the file bin/geotifcp.c. This function is part of the "Copy Loop Handler" component, which is responsible for converting GeoTIFF files from strip-based organization to tile-based organization (or vice versa).

The core issue is a lack of bounds checking on memory allocation and copying operations. The function accepts parameters derived from the input GeoTIFF file's metadata:

  • tile width

  • tile length

  • StripOffsets

  • StripByteCounts
  • An attacker can craft a malicious GeoTIFF file where these metadata fields contain values that are inconsistent with the actual data size or exceed the allocated buffer limits. When cpStripToTile attempts to copy data from the strips into the tile buffer using these unvalidated dimensions, it writes beyond the allocated memory boundary. This results in a stack or heap buffer overflow, potentially leading to arbitrary code execution or denial of service.

    CVSS Vector Interpretation (CVSS:4.0)

  • AV:N (Network): The attack can be launched remotely. This implies that geotifcp or a service using libgeotiff processes user-supplied GeoTIFF files over a network (e.g., a web service that ingests geospatial data).
  • AC:L (Low Complexity): No special conditions are required; the exploit is reliable.
  • AT:N (No Automation): The attacker does not need to bypass automated defenses (like ASLR/DEP) via complex techniques, though standard exploitation techniques apply.
  • PR:N (No Privileges): No prior authentication is required.
  • UI:P (User Interaction): The victim must perform an action, such as opening a malicious file or submitting it to a processing service.
  • VC:L/VI:L/VA:L: Low impact on Confidentiality, Integrity, and Availability. This suggests that while code execution is possible, the immediate impact might be limited to crashing the process (DoS) or limited data leakage, depending on the exploitation technique. However, in a server context, RCE could lead to higher impact, but the CVSS score reflects the base* impact of the vulnerability itself.
  • E:P (Exploit Maturity): Publicly disclosed exploit code exists.
  • ⚡ Attack Chain

    1. Discovery & Reconnaissance

  • Target Identification: The attacker identifies a web application, API, or service that uses libgeotiff (specifically version 1.7.0 to 1.7.4) to process GeoTIFF files. Common targets include GIS web services, satellite image processing pipelines, or open-source geospatial platforms.
  • Version Fingerprinting: The attacker may check HTTP headers, error messages, or documentation to confirm the version of libgeotiff or geotifcp in use. If the service exposes a version endpoint or if the error message from a malformed file reveals the library version, this confirms the target.
  • Input Vector Identification: The attacker identifies the endpoint that accepts GeoTIFF file uploads (e.g., /api/upload, /process/tiff).
  • 2. Exploitation

    The attacker crafts a malicious GeoTIFF file. The GeoTIFF format allows for extensive metadata. The attacker manipulates the StripOffsets and StripByteCounts tags to specify a large data size, while the actual file contains minimal data. When geotifcp (or the library function) reads these tags and allocates/copies memory based on them, the buffer overflow occurs.

    Illustrative PoC Concept (Python using struct to craft a minimal malicious GeoTIFF):
    Note: The following is an illustrative example of the vulnerability class. The exact byte offsets and structure depend on the specific GeoTIFF implementation and version. A real exploit would require precise knowledge of the cpStripToTile function's memory layout.

    import struct
    
    # Illustrative PoC: Crafting a malicious GeoTIFF header
    # This is a simplified representation. A real exploit would need to
    # correctly set up the TIFF header, IFD, and GeoTIFF tags.
    
    def create_malicious_geotiff(filename):
        # TIFF Header (Little Endian)
        tiff_header = struct.pack('<2sHI', b'II', 42, 8)
        
        # IFD (Image File Directory)
        # Number of entries
        num_entries = 3
        ifd = struct.pack('<H', num_entries)
        
        # Tag 1: ImageWidth (Short)
        # Tag 2: ImageLength (Short)
        # Tag 3: StripOffsets (Long) - Malicious value
        # Tag 4: StripByteCounts (Long) - Malicious value
        
        # For simplicity, we'll just show the concept of setting large values
        # In a real exploit, these would be set to values that cause overflow
        # when the function tries to copy data based on them.
        
        # Example: Setting StripByteCounts to a very large value
        malicious_strip_byte_count = 0x10000000  # 256MB, likely exceeding buffer
        
        # ... (Constructing the full IFD and data section would be complex)
        # The key is that the metadata claims a large size, but the actual data
        # is small, or the buffer allocated is smaller than the claimed size.
        
        with open(filename, 'wb') as f:
            f.write(tiff_header)
            # ... write rest of malicious structure ...
            
        print(f"Malicious GeoTIFF created: {filename}")
    
    # create_malicious_geotiff('malicious.tif')

    Exploitation Steps:
    1. Craft Payload: The attacker uses a tool like the Python script above (or a more sophisticated fuzzer) to create a GeoTIFF file with manipulated StripOffsets and StripByteCounts.
    2. Delivery: The attacker sends the malicious file to the target service via an HTTP POST request.

    curl -X POST http://target-gis-service/api/upload \
             -F "[email protected]" \
             -H "Content-Type: multipart/form-data"

    3. Trigger: The server-side application calls geotifcp or a function in libgeotiff to process the file. The cpStripToTile function reads the malicious metadata and attempts to copy data, triggering the buffer overflow.
    4. Exploit Execution: If the overflow corrupts the return address or function pointers, the attacker can redirect execution to shellcode embedded in the file or environment. If the overflow is on the stack, it may crash the process (DoS).

    3. Post-Exploitation

  • Denial of Service (DoS): The most likely immediate impact is a crash of the geotifcp process or the web service worker, leading to unavailability.
  • Remote Code Execution (RCE): If the attacker successfully exploits the buffer overflow to gain code execution, they can:
  • * Spawn a reverse shell. * Escalate privileges if the service runs with elevated permissions. * Exfiltrate sensitive geospatial data or other files on the server. * Install persistent backdoors.

    🌍 Real World Impact

  • Confidentiality (Low): The CVSS score indicates low impact on confidentiality. This suggests that while data leakage is possible, it is not the primary or guaranteed outcome. An attacker might be able to read some memory contents, but controlled data exfiltration is less likely without further exploitation.
  • Integrity (Low): Low impact on integrity. The attacker may be able to modify some data or system state, but widespread corruption is not the primary risk.
  • Availability (Low): Low impact on availability. The primary risk is a crash (DoS) of the specific process handling the file. If the service is not robustly designed to handle crashes, this could lead to a temporary outage.
  • Practical Consequences:
  • * GIS Services: Web-based GIS platforms that allow users to upload GeoTIFF files are at risk. An attacker could crash the service, causing downtime. * Data Processing Pipelines: Automated pipelines that process large volumes of GeoTIFF files could be disrupted by a single malicious file, leading to data loss or processing delays. * Supply Chain Risk: Since libgeotiff is a foundational library, any application that links against it and processes untrusted GeoTIFF files is vulnerable. This includes desktop applications, server-side processing tools, and embedded systems.

    🛡️ Remediation & Mitigation

    1. Patching

  • Affected Versions: libgeotiff versions 1.7.0 through 1.7.4.
  • Recommendation: Upgrade to the latest version of libgeotiff (1.7.5 or later, once released) that includes the fix for cpStripToTile. The project was informed but has not responded yet, so users should monitor the project's repository for a patch.
  • Workaround: If upgrading is not immediately possible, consider disabling the geotifcp utility or any functionality that uses cpStripToTile if it is not critical.
  • 2. Input Validation & Sanitization

  • Validate GeoTIFF Metadata: Before processing a GeoTIFF file, validate the StripOffsets, StripByteCounts, TileWidth, and TileLength fields. Ensure that the total size of the data does not exceed the file size or a reasonable limit.
  • Use Safe Libraries: If possible, use a more recent or actively maintained library for GeoTIFF processing that has undergone security audits.
  • 3. WAF/ModSecurity Rules

  • File Type Validation: Ensure that only valid GeoTIFF files are accepted. Use a WAF rule to check the file header and structure.
  • Size Limits: Enforce strict file size limits on uploads to prevent large payloads that could be used for exploitation.
  • ModSecurity Example (Illustrative):
  • # Block files with suspicious GeoTIFF metadata
        SecRule REQUEST_FILENAME "\.tif$" \
            "phase:2,log,pass,id:1000,msg:'Suspicious GeoTIFF file',setvar:tx.blocked=1"
        
        # Check for large StripByteCounts (example, adjust threshold)
        SecRule FILES_TMP_FILENAME "@rx \.tif$" \
            "phase:2,log,pass,id:1001,msg:'Large GeoTIFF file',setvar:tx.blocked=1"

    Note: WAF rules for binary file content are complex and may require custom plugins or external validation scripts.

    4. Detection & IoCs

  • Web Server Logs: Look for POST requests to upload endpoints with .tif or .tiff file extensions. Monitor for repeated failed uploads or crashes.
  • Process Crashes: Monitor for unexpected crashes of geotifcp or related processes. Use system logs (e.g., syslog, journalctl) to detect segmentation faults or core dumps.
  • File Integrity Monitoring (FIM): Monitor for unexpected changes to libgeotiff binaries or configuration files.
  • Network Traffic: Look for unusual outbound connections from the GIS service, which could indicate data exfiltration or reverse shell activity.
  • ⚠️ Urgency

  • CVSS Score: 6.3 (Medium)
  • CISA KEV: No
  • Exploit Availability: Publicly disclosed
  • Patch Status: No official patch yet (project unresponsive)
Patching Priority: Medium-High

Although the CVSS score is medium, the availability of a public exploit and the lack of a patch from the project increase the urgency. Organizations that process untrusted GeoTIFF files should:
1. Immediately implement input validation and file size limits.
2. Monitor the libgeotiff project for a patch.
3. Consider temporarily disabling the geotifcp utility or the specific feature that uses it if it is not critical.
4. Prepare for a potential patch release and test it in a staging environment before deploying to production.

Given the public exploit, this vulnerability should be treated as a high-priority issue for any organization that exposes GeoTIFF processing to untrusted users.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="OSGeo libgeotiff"
PoC & Exploit Intelligence (GitHub)
Technical reference / advisory repository for CVE-2026-138214
Technical reference / advisory repository for CVE-2026-138214
CVSS Score
6.3 / 10 · CVSS MEDIUM
Weakness Types (CWE)
CWE-119 CWE-120
Affected Products (1)
OSGeo:libgeotiff
Related CVEs
10.0
CVE-2026-144884
A vulnerability was determined in D-Link DIR-505 1.10B02. The affected element is the function get_input_entri
9.2
CVE-2026-144500
ASN1SCC before 4.7.0.1 contains a buffer overflow vulnerability in Xer_DecodePrimitiveElement() in asn1crt/asn
6.3
CVE-2026-144771
A flaw has been found in SGLang up to 0.5.23. The affected element is the function try_match_prefix of the fil
6.3
CVE-2026-144778
A security vulnerability has been detected in Simon OpenOBJ3D up to f5a522c409428de7bf68844cf8951522e3d09485.
6.3
CVE-2026-144888
A security vulnerability has been detected in vgmstream up to r2117. Affected is the function fopen_win of the
6.3
CVE-2026-144889
A vulnerability was detected in vgmstream r2117. Affected by this vulnerability is the function vgmstream_tags
6.3
CVE-2026-144893
A vulnerability was determined in vgmstream up to r2117. This issue affects the function get_falcom_looping of