CVE-2026-136908 in libyanginfo

Summary

by MITRE • 11/25/2026

libyang through 6.4.13 contains a release of invalid pointer vulnerability in ly_in_memory() and ly_in_memory_chunk() in src/in.c that return the current read position instead of the previous start address. Attackers supplying YANG data parsed from a heap buffer can cause applications freeing the returned pointer to pass an interior address to free(), aborting the process.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 11/25/2026

The vulnerability identified in libyang versions through 6.4.13 represents a critical memory management flaw within the input handling subsystem, specifically affecting the ly_in_memory and ly_in_memory_chunk functions located in src/in.c. This issue stems from an incorrect pointer arithmetic logic where these functions are designed to return pointers for subsequent parsing operations but instead erroneously provide the current read position rather than the original start address of the allocated heap buffer. In standard C memory management, when a block of dynamic memory is allocated using functions such as malloc or calloc, the application retains ownership and responsibility for freeing that specific base pointer at some point during its lifecycle to prevent memory leaks. The fundamental expectation in this context is that any wrapper function returning an input stream object must preserve access to the original allocation boundary so that cleanup routines can correctly deallocate the entire block of memory associated with that data structure.

When a developer utilizes libyang to parse YANG schema or instance data provided from a heap buffer, they typically rely on these internal functions to initialize the parsing context. The flaw causes the library to return an interior pointer—a value pointing somewhere within the allocated memory region rather than at its beginning. If the application code follows standard practices and attempts to free this returned pointer using the C standard library function free(), it violates a fundamental rule of memory management: passing any address that is not exactly the one originally returned by malloc, calloc, or realloc results in undefined behavior. In most modern operating systems with robust heap managers such as glibc on Linux or Heap Manager on Windows, detecting an invalid pointer passed to free triggers immediate protection mechanisms designed to prevent further exploitation or corruption of memory structures.

The operational impact of this vulnerability is severe and primarily manifests as a denial-of-service condition through application termination. When the process receives an interior address for deallocation, the heap manager detects the inconsistency in metadata pointers that track allocated blocks. This detection typically leads to the immediate invocation of abort() or raise(SIGABRT), causing the entire application running libyang to crash abruptly. For services relying on continuous availability such as network configuration management systems, API gateways, or automated deployment tools that process YANG data dynamically, this crash can lead to significant service disruption. While the primary impact is stability-related, in complex environments where memory corruption might precede detection, there remains a theoretical risk of more severe exploitation vectors if an attacker can control the offset within the heap buffer to manipulate internal allocator structures before the abort occurs, although the immediate and guaranteed outcome is process termination.

From a classification perspective, this vulnerability aligns with CWE-416: Use After Free, specifically in the context of improper pointer arithmetic leading to invalid memory access during deallocation. It also relates closely to CWE-789: Uncontrolled Memory Allocation if viewed through the lens of how the internal state is managed incorrectly relative to external expectations. In terms of attack patterns, this falls under MITRE ATT&CK technique T1499: Endpoint Denial of Service, as an attacker can supply crafted YANG data that triggers the faulty pointer return and subsequent crash when the application attempts cleanup. The vulnerability highlights a critical gap in input validation and internal state consistency within the library's memory handling routines.

Mitigation strategies for this issue involve immediate upgrading to libyang version 6.4.14 or later, where the developers have corrected the logic in ly_in_memory and ly_in_memory_chunk to ensure they return the correct start address of the allocated buffer rather than the current read position. For applications unable to upgrade immediately due to dependency constraints, a temporary workaround involves avoiding direct calls to free() on pointers returned by these specific input initialization functions if possible, or ensuring that any custom wrappers around libyang explicitly track and store the original base pointer separately from what is passed back into the library for parsing operations. Additionally, developers should implement robust error handling and logging mechanisms to detect unexpected crashes during YANG data processing phases, which can aid in identifying instances where this vulnerability might be triggered by malformed or maliciously crafted input files. Regular security audits of code that interacts with libyang's memory management interfaces are recommended to ensure compliance with safe pointer arithmetic practices and proper resource lifecycle management.

Responsible

VulnCheck

Reservation

11/25/2026

Disclosure

11/25/2026

Moderation

accepted

CPE

ready

EPSS

0.00874

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!