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

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.

Technologies: CESNET Libyang. Vendors: CESNET.

Quick answers

Is CVE-2026-41401 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-41401 being exploited in the wild.
How severe is CVE-2026-41401?
Medium severity, with a CVSS score of 6.5, published 26 May 2026.
Which products and versions are affected?
CESNET Libyang < 5.2.6.
Is there a fix for CVE-2026-41401?
A patch was published on 2026-03-26: Patch released in version 5.2.6 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-41401 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-41401?
Check whether you run CESNET Libyang at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

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

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.