Junglewise Threat Intelligence

CVE-2026-41401: CESNET libyang heap use-after-free in lyd_parser_set_data_flags

CVE-2026-41401 · Severity: medium · CVSS 6.5 · Published 2026-05-26

Executive brief

libyang is a software library used to parse and manage YANG data, often used in network management protocols like NETCONF and RESTCONF. A vulnerability in how it handles XML metadata allows an attacker to send a specially crafted document that causes the application to crash or potentially execute unauthorized code. This could lead to a service outage or a compromise of the system processing the network configuration data.

Technical details

A heap use-after-free write vulnerability exists in libyang's XML data parser within the 'lyd_parser_set_data_flags' function in 'src/parser_common.c'. The root cause is an incorrect update of the metadata linked list head pointer when freeing a non-head 'default' metadata entry. An attacker can trigger this by submitting a crafted YANG XML document with specific metadata attributes to an application using libyang to parse untrusted data. This results in a reference to freed heap memory being subsequently written to in 'lyd_insert_meta', leading to memory corruption, process crashes, or potential remote code execution. The issue is fixed in version 5.2.6.

Affected products

  • CESNET libyang < 5.2.6

Timeline

  • 2026-03-26: patched: Patch released in version 5.2.6
  • 2026-03-26: advisory: GitHub Security Advisory published
  • 2026-05-26: disclosed: CVE published to NVD

References

Related threats