Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-112048 Overview
CVE-2026-112048 affects libspatialite through version 5.1.0, a widely used spatial extension for SQLite. The library fails to validate the polygon ring count in the ParseWkbPolygon function. Attackers can supply crafted Well-Known Binary (WKB) geometry BLOBs that trigger uncontrolled interior-ring allocation. Processing a malicious polygon through a SpatiaLite database or an ST_GeomFromWKB call can crash the host process or corrupt heap memory on 32-bit builds. The flaw is classified under [CWE-789: Memory Allocation with Excessive Size Value].
Critical Impact
Local attackers can trigger process crashes or heap corruption on 32-bit builds by submitting a crafted polygon geometry to any application that parses untrusted WKB input through libspatialite.
Affected Products
- libspatialite versions up to and including 5.1.0
- Applications linking libspatialite for spatial query processing
- SQLite-based tools and GIS pipelines that accept external WKB or SpatiaLite databases
Discovery Timeline
- 2026-10-18 - CVE-2026-112048 published to NVD
- 2026-10-20 - Last updated in NVD database
Technical Details for CVE-2026-112048
Vulnerability Analysis
The vulnerability resides in ParseWkbPolygon within src/gaiageo/gg_wkb.c. The function reads a 32-bit ring count from attacker-controlled WKB data and uses that value to size interior-ring allocations without bounds validation. A crafted polygon can declare a ring count that far exceeds the available data in the BLOB.
When the parser trusts this count, it attempts to allocate memory proportional to the declared value. On 64-bit systems the request typically fails or exhausts memory and aborts the process. On 32-bit builds the multiplication involved in the allocation size can wrap, producing an undersized buffer that is subsequently written past its bounds. This produces heap corruption suitable for further exploitation primitives.
The issue is reachable through any entry point that forwards untrusted geometry to libspatialite, including the ST_GeomFromWKB SQL function and opening of attacker-supplied SpatiaLite databases.
Root Cause
The root cause is missing validation between the declared ring count in the WKB header and the actual remaining byte length of the BLOB. The parser does not confirm that the number of rings is representable without integer overflow when multiplied by the per-ring structure size. This maps to [CWE-789] because allocation size is derived directly from untrusted input.
Attack Vector
Exploitation requires local delivery of a crafted geometry. An attacker provides either a malicious SpatiaLite database that a victim opens or a WKB payload submitted to an application that calls ST_GeomFromWKB. User interaction is required to load or query the data. Successful exploitation yields denial of service on all platforms and potential heap memory corruption on 32-bit builds.
See the VulnCheck Advisory on Libspatialite and the HackMD Vulnerability Report for the technical write-up and the Gaia GIS Source Code File for the vulnerable code path.
Detection Methods for CVE-2026-112048
Indicators of Compromise
- Process crashes or SIGSEGV signals originating from libspatialite within applications parsing geometry data.
- Abnormal memory growth in services calling ST_GeomFromWKB or opening SpatiaLite .sqlite files from untrusted sources.
- Core dumps that reference ParseWkbPolygon or gg_wkb.c frames in the stack trace.
Detection Strategies
- Scan dependency inventories and software bills of materials for libspatialite versions at or below 5.1.0.
- Audit application code paths that forward user-controlled BLOBs into SpatiaLite SQL functions such as ST_GeomFromWKB, GeomFromWKB, and related converters.
- Deploy runtime sanitizers such as AddressSanitizer in staging to catch oversized allocations triggered by test corpora of malformed WKB inputs.
Monitoring Recommendations
- Log and alert on repeated process restarts of GIS services, database workers, or import pipelines that process spatial data.
- Monitor heap allocator metrics for sudden spikes correlated with specific SQL queries against spatial tables.
- Collect endpoint telemetry on child-process termination within applications known to embed libspatialite.
How to Mitigate CVE-2026-112048
Immediate Actions Required
- Inventory all systems and container images that bundle libspatialite 5.1.0 or earlier.
- Restrict ingestion of untrusted SpatiaLite databases and WKB inputs until a patched build is deployed.
- Isolate GIS processing workloads so that a crash or heap corruption in the parser cannot pivot to adjacent services.
Patch Information
At the time of publication, no fixed release is referenced in the NVD entry. Monitor the Gaia GIS Source Code File repository and distribution security trackers for an updated libspatialite build that validates the polygon ring count against the remaining BLOB length. Rebuild and redistribute downstream applications once a patched version is available.
Workarounds
- Prefer 64-bit builds of libspatialite, which limit the impact to denial of service rather than heap corruption.
- Validate incoming WKB BLOBs at the application layer, rejecting polygons whose declared ring count exceeds a conservative upper bound.
- Run spatial parsing in a sandboxed or least-privilege worker process so that a crash cannot affect the parent service.
- Disable SQL functions such as ST_GeomFromWKB for untrusted callers where feasible.
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

