Skip to main content

CESNET libyang EUVDEUVD-2026-135440

| CVE-2026-136905 MEDIUM
Incomplete Cleanup (CWE-459)
2026-11-25 VulnCheck GHSA-xxgp-q489-jhv8
6.3
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Reach app reusing one ly_out handler
  2. Delivery
    Prior client writes long output to file
  3. Exploit
    Handler reset rewinds but skips truncate
  4. Execution
    Shorter output leaves stale trailing bytes
  5. Impact
    Next client reads leftover previous-client data

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Incomplete cleanup
Exploitation Conditions

Exploitation requires an application that (1) uses libyang's output layer writing to a SEEKABLE target - a regular file fd (out->method.fd) or FILE* stream (out->method.f), not a pipe/socket - and (2) reuses a single ly_out handler via ly_out_reset() to serialize output for multiple clients or requests in sequence. The leak only manifests when errno happens to hold ESPIPE at reset time (left from a prior operation) AND the seek succeeds, causing ftruncate() to be skipped; and when the earlier client's serialized output is LONGER than the current one, so stale trailing bytes survive the rewind. Limiting factors that reduce real-world risk: it is not remotely triggerable against a default single-use configuration, requires the specific handler-reuse-across-clients deployment pattern, requires a seekable file backing (streams to pipes/sockets return ESPIPE legitimately and are unaffected), and discloses only residual bytes rather than attacker-chosen data. Authentication requirements are not applicable in the usual sense - the CVSS lists PR:N, but the 'attacker' is effectively a downstream consumer of the reused output.

Impact

This is a genuine but low-urgency information-disclosure issue (CWE-459, incomplete cleanup). The input CVSS 4.0 vector (AV:N/AC:H/AT:P/PR:N/UI:N) scores 6.3 (Medium), and the only impact is a limited confidentiality leak (VC:L) with no integrity or availability effect. The high attack complexity (AC:H) and the Attack Requirements flag (AT:P) correctly reflect that exploitation is not straightforward: it depends on a specific application usage pattern and on residual state (a stale ESPIPE errno) rather than attacker-controlled input. No CISA KEV listing is present in the input, so this is not confirmed actively exploited; no EPSS score was supplied, so widespread-exploitation probability cannot be quantified. No proof-of-concept exploit is referenced - the GitHub links are the vendor patch, the vulnerable source lines, and a VulnCheck advisory, none of which is working exploit code. The vendor's own priority label is 'this_month', consistent with a Medium-severity data-leak bug that warrants scheduled patching rather than emergency response. Net assessment: a real, patchable correctness/privacy defect in a networking library, but a low-priority one absent evidence of exploitation; the leak only matters for applications that reuse a single output handler across trust boundaries.

Exploit ScenarioDerived

An application built on libyang reuses one ly_out output handler bound to a seekable regular file to serialize responses for multiple clients in sequence. Because ly_out_reset() tests a stale ESPIPE errno after a successful seek, it rewinds the file but skips truncation, so when a later client's output is shorter than a previous client's, the trailing bytes of the earlier client's data remain and are disclosed. No public exploit is identified at time of analysis; the attacker role here is effectively a subsequent consumer of the reused handler's output rather than someone sending a crafted payload.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 25, 2026

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.

RemediationAI

Vendor patch available: the fix is merged upstream as pull request https://github.com/CESNET/libyang/pull/2644 with commit https://github.com/CESNET/libyang/commit/98a4d748f5b744cc9011bb8ade972d69167ed17e - upstream fix available (PR/commit); a released patched version number is not independently confirmed from the supplied data, so confirm the version that carries commit 98a4d748 before deploying. Because the defect is in a library, remediation requires rebuilding applications against the corrected libyang rather than any runtime configuration change. If immediate upgrade is not possible, the practical compensating controls are application-side: do not reuse a single ly_out handler across clients or requests when writing to a seekable file - close and reopen (or explicitly ftruncate) the target between clients, at the cost of additional file open/close overhead - or route output through pipe/socket targets where lseek legitimately fails with ESPIPE and the incorrect path is not taken, at the cost of losing positional output. Note that clearing errno alone is not a durable fix since other libyang calls may set it again; only the restructured logic in the upstream commit makes truncation unconditional on a successful seek. Advisory reference: https://www.vulncheck.com/advisories/libyang-through-6.4.13-incomplete-cleanup-in-ly-out-reset.

Affected VersionsENISA

libyang 0 ≤6.4.13

Affected Packages

euvd libyang no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

libyang is CESNET's C library for parsing, validating and serializing YANG models, widely embedded in NETCONF/RESTCONF servers and network management tooling. Its output abstraction (struct ly_out) can be backed either by a raw file descriptor (out->method.fd) or by a stdio stream (out->method.f), and ly_out_reset() is the API used to rewind that target so the same handler can be reused. The defect class is CWE-459 (incomplete cleanup): the original code tested (lseek(...) -1) && (errno != ESPIPE) and then separately tested (errno != ESPIPE) && ftruncate(...). Because errno is only meaningful after a failing call and is never cleared on success, an ESPIPE left over from a previous operation makes the truncation step silently conditional on stale state even though the seek succeeded, leaving the implementation with a rewind but no truncate. The upstream patch restructures both the fd and FILE* branches into an if/else-if so that ftruncate()/ftruncate() runs exactly when the seek succeeds, and adds regression tests in tests/utests/basic/test_inout.c that deliberately set errno = ESPIPE and assert the file is truncated (fseek to end, ftell 8). Non-seekable targets such as pipes and sockets legitimately return ESPIPE and are unaffected, and the trigger otherwise requires the handler-reuse-across-clients deployment pattern described in the advisory.

Know when Libyang gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 6.3 MEDIUM
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
vuln.today AI 3.7 LOW

Leak surfaces through a network-reachable library consumer (AV:N) but only under a specific handler-reuse-plus-stale-errno condition (AC:H); no privileges needed by the benefiting client (PR:N); limited confidentiality only (C:L), no integrity/availability impact.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
High
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

CESNET libyang through 6.4.13 contains an incomplete cleanup vulnerability in ly_out_reset() in src/out.c that tests a stale errno ESPIPE value after a successful seek. Applications reusing one output handler for different clients rewind but do not truncate the file, leaking leftover bytes of a previous client's output.

Threat Intelligence Overview

EPSS Score
0.5%
Top 63% exploitable
Prevalence
Medium
specialized YANG/NETCONF C library common in network management stacks, not ubiquitous
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

33
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +32
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

CVE-2023-26917 HIGH POC
7.5 Apr 11

libyang from v2.0.164 to v2.1.30 was discovered to contain a NULL pointer dereference via the function lysp_stmt_validat

CVE-2021-28906 HIGH POC
7.5 May 20

In function read_yin_leaf() in libyang <= v1.0.225, it doesn't check whether the value of retval->ext[r] is NULL. Rated

CVE-2021-28905 HIGH POC
7.5 May 20

In function lys_node_free() in libyang <= v1.0.225, it asserts that the value of node->module can't be NULL. Rated high

CVE-2021-28904 HIGH POC
7.5 May 20

In function ext_get_plugin() in libyang <= v1.0.225, it doesn't check whether the value of revision is NULL. Rated high

CVE-2021-28903 HIGH POC
7.5 May 20

A stack overflow in libyang <= v1.0.225 can cause a denial of service through function lyxml_parse_mem(). Rated high sev

CVE-2021-28902 HIGH POC
7.5 May 20

In function read_yin_container() in libyang <= v1.0.225, it doesn't check whether the value of retval->ext[r] is NULL. R

CVE-2019-19334 CRITICAL
9.8 Dec 06

In all versions of libyang before 1.0-r5, a stack-based buffer overflow was discovered in the way libyang parses YANG fi

CVE-2019-19333 CRITICAL
9.8 Dec 06

In all versions of libyang before 1.0-r5, a stack-based buffer overflow was discovered in the way libyang parses YANG fi

CVE-2026-136908 HIGH
8.2 Nov 25

Freeing the pointer returned by libyang's in-memory input helpers can hand an interior heap address to free() and abort

CVE-2026-41401 HIGH
7.1 May 26

Heap use-after-free write in libyang before 5.2.6 enables remote authenticated attackers to crash processes or potential

CVE-2026-136907 MEDIUM
6.3 Nov 25

Wrong-status-code handling in CESNET libyang through 6.4.13 causes ly_in_filepath() in src/in.c to report success when t

CVE-2026-136906 MEDIUM
6.3 Nov 25

A file descriptor leak in libyang through 6.4.13 lets an attacker who can feed files into the library's by-path parsers

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy