CVE-2026-138214 — OSGeo Libgeotiff — CWE-119 · CWE-120
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.
🎯 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 functioncpStripToTile 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 widthtile lengthStripOffsetsStripByteCounts- AV:N (Network): The attack can be launched remotely. This implies that
geotifcpor a service usinglibgeotiffprocesses 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.
- 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
libgeotifforgeotifcpin 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).
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)
⚡ Attack Chain
1. Discovery & Reconnaissance
2. Exploitation
The attacker crafts a malicious GeoTIFF file. The GeoTIFF format allows for extensive metadata. The attacker manipulates theStripOffsets 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
geotifcp process or the web service worker, leading to unavailability.🌍 Real World Impact
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
libgeotiff versions 1.7.0 through 1.7.4.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.geotifcp utility or any functionality that uses cpStripToTile if it is not critical.2. Input Validation & Sanitization
StripOffsets, StripByteCounts, TileWidth, and TileLength fields. Ensure that the total size of the data does not exceed the file size or a reasonable limit.3. WAF/ModSecurity Rules
# 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
.tif or .tiff file extensions. Monitor for repeated failed uploads or crashes.geotifcp or related processes. Use system logs (e.g., syslog, journalctl) to detect segmentation faults or core dumps.libgeotiff binaries or configuration files.⚠️ Urgency
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]
FOFA Query