Libyang
Monthly
Freeing the pointer returned by libyang's in-memory input helpers can hand an interior heap address to free() and abort the host process. libyang through 6.4.13 is affected: after any read advances the input cursor, ly_in_memory() and ly_in_memory_chunk() return in->current rather than in->start, so applications that parse YANG data from a heap buffer and later release the returned pointer crash rather than continue. Impact is availability only (no code execution, no data disclosure); the flaw requires a caller that actually frees that pointer, exploitation is rated difficult (AV:N/AC:H/AT:P in the assessed CVSS:3.1 vector), and no public exploit code was identified at time of analysis. The upstream fix is PR #2641 / commit 76c8009e.
Heap use-after-free write in libyang before 5.2.6 enables remote authenticated attackers to crash processes or potentially execute code by submitting crafted YANG XML documents to applications using the library for parsing. The flaw resides in lyd_parser_set_data_flags, which mishandles metadata list pointers when freeing non-head default metadata entries. No public exploit identified at time of analysis, EPSS is low at 0.03%, and SSVC rates technical impact as partial with no automatable exploitation.
In CESNET libyang through 6.4.13, ly_out_reset() in src/out.c rewinds a seekable output target but can skip the accompanying truncate, so bytes written for an earlier client survive into the output produced for a later one. The flaw only surfaces in deployments that reuse a single ly_out handler across clients or requests writing to a regular file or FILE* stream, and only when a stale ESPIPE value lingers in errno while the seek itself succeeds; it discloses residual bytes rather than attacker-chosen data. Severity is rated 6.3 (CVSS 4.0) and the issue is assessed as a genuine but low-urgency information-disclosure problem (CWE-459, incomplete cleanup) with no confirmed active exploitation (CISA KEV) and no public exploit identified at time of analysis; an upstream fix is available as a pull request and commit.
A file descriptor leak in libyang through 6.4.13 lets an attacker who can feed files into the library's by-path parsers (lyd_parse_data_path() or lys_parse_path()) exhaust a process's descriptor table and cause subsequent file and socket operations to fail. The leak occurs in ly_in_new_filepath() and ly_in_filepath() in src/in.c when opening or mapping the supplied file fails - the vendor's own test exercises it with an empty file and with an unopenable path - so repeated submission of such files accumulates leaked descriptors. Impact is limited to availability of the consuming process (no confidentiality or integrity effect), no public exploit code was identified at time of analysis, and an upstream fix commit is available.
Wrong-status-code handling in CESNET libyang through 6.4.13 causes ly_in_filepath() in src/in.c to report success when the requested file cannot be opened or mmap'd, so a reused struct ly_in input handler keeps serving the previously loaded file's mapped bytes. Applications that switch a shared handler to a new path and trust the return value can therefore parse stale data as if it were the requested input, giving limited confidentiality and integrity impact (CVSS 6.3; assessed CVSS:3.1/AV:N/AC:H/PR:N/UI:N/C:L/I:L/A:N). Exploitation is gated on a specific handler-reuse code path in the consuming application plus attacker influence over the switched filepath rather than on privileges; no public exploit code was identified at the time of analysis and the issue is not in CISA KEV, with an upstream fix commit available.
Authenticated NETCONF peers can crash libyang-based servers such as netopeer2 by sending an rpc <action> envelope containing non-whitespace character data to lyd_parse_op(), causing an uninitialized pointer free in lydxml_env_netconf_rpc() and possible heap corruption. The issue affects libyang through 6.4.13 and is a moderate-priority, authenticated denial-of-service flaw: exploitation requires an established NETCONF session, and whether the result is a reliable crash or heap corruption depends on memory state (AC:H/AT:P). No CISA KEV entry or confirmed working exploit code is described in the supplied data; a public technical writeup is referenced, and a vendor patch commit is available.
libyang from v2.0.164 to v2.1.30 was discovered to contain a NULL pointer dereference via the function lysp_stmt_validate_value at lys_parse_mem.c. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available and no vendor patch available.
libyang from v2.0.164 to v2.1.30 was discovered to contain a NULL pointer dereference via the function lys_parse_mem at lys_parse_mem.c. Rated medium severity (CVSS 5.3), this vulnerability is remotely exploitable, no authentication required, low attack complexity. No vendor patch available.
In function read_yin_leaf() in libyang <= v1.0.225, it doesn't check whether the value of retval->ext[r] is NULL. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available and no vendor patch available.
In function lys_node_free() in libyang <= v1.0.225, it asserts that the value of node->module can't be NULL. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available and no vendor patch available.
In function ext_get_plugin() in libyang <= v1.0.225, it doesn't check whether the value of revision is NULL. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available and no vendor patch available.
A stack overflow in libyang <= v1.0.225 can cause a denial of service through function lyxml_parse_mem(). Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available and no vendor patch available.
In function read_yin_container() in libyang <= v1.0.225, it doesn't check whether the value of retval->ext[r] is NULL. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available and no vendor patch available.
In all versions of libyang before 1.0-r5, a stack-based buffer overflow was discovered in the way libyang parses YANG files with a leaf of type "identityref". Rated critical severity (CVSS 9.8), this vulnerability is remotely exploitable, no authentication required, low attack complexity.
In all versions of libyang before 1.0-r5, a stack-based buffer overflow was discovered in the way libyang parses YANG files with a leaf of type "bits". Rated critical severity (CVSS 9.8), this vulnerability is remotely exploitable, no authentication required, low attack complexity.
Freeing the pointer returned by libyang's in-memory input helpers can hand an interior heap address to free() and abort the host process. libyang through 6.4.13 is affected: after any read advances the input cursor, ly_in_memory() and ly_in_memory_chunk() return in->current rather than in->start, so applications that parse YANG data from a heap buffer and later release the returned pointer crash rather than continue. Impact is availability only (no code execution, no data disclosure); the flaw requires a caller that actually frees that pointer, exploitation is rated difficult (AV:N/AC:H/AT:P in the assessed CVSS:3.1 vector), and no public exploit code was identified at time of analysis. The upstream fix is PR #2641 / commit 76c8009e.
Heap use-after-free write in libyang before 5.2.6 enables remote authenticated attackers to crash processes or potentially execute code by submitting crafted YANG XML documents to applications using the library for parsing. The flaw resides in lyd_parser_set_data_flags, which mishandles metadata list pointers when freeing non-head default metadata entries. No public exploit identified at time of analysis, EPSS is low at 0.03%, and SSVC rates technical impact as partial with no automatable exploitation.
In CESNET libyang through 6.4.13, ly_out_reset() in src/out.c rewinds a seekable output target but can skip the accompanying truncate, so bytes written for an earlier client survive into the output produced for a later one. The flaw only surfaces in deployments that reuse a single ly_out handler across clients or requests writing to a regular file or FILE* stream, and only when a stale ESPIPE value lingers in errno while the seek itself succeeds; it discloses residual bytes rather than attacker-chosen data. Severity is rated 6.3 (CVSS 4.0) and the issue is assessed as a genuine but low-urgency information-disclosure problem (CWE-459, incomplete cleanup) with no confirmed active exploitation (CISA KEV) and no public exploit identified at time of analysis; an upstream fix is available as a pull request and commit.
A file descriptor leak in libyang through 6.4.13 lets an attacker who can feed files into the library's by-path parsers (lyd_parse_data_path() or lys_parse_path()) exhaust a process's descriptor table and cause subsequent file and socket operations to fail. The leak occurs in ly_in_new_filepath() and ly_in_filepath() in src/in.c when opening or mapping the supplied file fails - the vendor's own test exercises it with an empty file and with an unopenable path - so repeated submission of such files accumulates leaked descriptors. Impact is limited to availability of the consuming process (no confidentiality or integrity effect), no public exploit code was identified at time of analysis, and an upstream fix commit is available.
Wrong-status-code handling in CESNET libyang through 6.4.13 causes ly_in_filepath() in src/in.c to report success when the requested file cannot be opened or mmap'd, so a reused struct ly_in input handler keeps serving the previously loaded file's mapped bytes. Applications that switch a shared handler to a new path and trust the return value can therefore parse stale data as if it were the requested input, giving limited confidentiality and integrity impact (CVSS 6.3; assessed CVSS:3.1/AV:N/AC:H/PR:N/UI:N/C:L/I:L/A:N). Exploitation is gated on a specific handler-reuse code path in the consuming application plus attacker influence over the switched filepath rather than on privileges; no public exploit code was identified at the time of analysis and the issue is not in CISA KEV, with an upstream fix commit available.
Authenticated NETCONF peers can crash libyang-based servers such as netopeer2 by sending an rpc <action> envelope containing non-whitespace character data to lyd_parse_op(), causing an uninitialized pointer free in lydxml_env_netconf_rpc() and possible heap corruption. The issue affects libyang through 6.4.13 and is a moderate-priority, authenticated denial-of-service flaw: exploitation requires an established NETCONF session, and whether the result is a reliable crash or heap corruption depends on memory state (AC:H/AT:P). No CISA KEV entry or confirmed working exploit code is described in the supplied data; a public technical writeup is referenced, and a vendor patch commit is available.
libyang from v2.0.164 to v2.1.30 was discovered to contain a NULL pointer dereference via the function lysp_stmt_validate_value at lys_parse_mem.c. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available and no vendor patch available.
libyang from v2.0.164 to v2.1.30 was discovered to contain a NULL pointer dereference via the function lys_parse_mem at lys_parse_mem.c. Rated medium severity (CVSS 5.3), this vulnerability is remotely exploitable, no authentication required, low attack complexity. No vendor patch available.
In function read_yin_leaf() in libyang <= v1.0.225, it doesn't check whether the value of retval->ext[r] is NULL. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available and no vendor patch available.
In function lys_node_free() in libyang <= v1.0.225, it asserts that the value of node->module can't be NULL. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available and no vendor patch available.
In function ext_get_plugin() in libyang <= v1.0.225, it doesn't check whether the value of revision is NULL. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available and no vendor patch available.
A stack overflow in libyang <= v1.0.225 can cause a denial of service through function lyxml_parse_mem(). Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available and no vendor patch available.
In function read_yin_container() in libyang <= v1.0.225, it doesn't check whether the value of retval->ext[r] is NULL. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no authentication required, low attack complexity. Public exploit code available and no vendor patch available.
In all versions of libyang before 1.0-r5, a stack-based buffer overflow was discovered in the way libyang parses YANG files with a leaf of type "identityref". Rated critical severity (CVSS 9.8), this vulnerability is remotely exploitable, no authentication required, low attack complexity.
In all versions of libyang before 1.0-r5, a stack-based buffer overflow was discovered in the way libyang parses YANG files with a leaf of type "bits". Rated critical severity (CVSS 9.8), this vulnerability is remotely exploitable, no authentication required, low attack complexity.