Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessReach app reusing one ly_out handler
-
DeliveryPrior client writes long output to file
-
ExploitHandler reset rewinds but skips truncate
-
ExecutionShorter output leaves stale trailing bytes
-
ImpactNext 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
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
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.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
libyang from v2.0.164 to v2.1.30 was discovered to contain a NULL pointer dereference via the function lysp_stmt_validat
In function read_yin_leaf() in libyang <= v1.0.225, it doesn't check whether the value of retval->ext[r] is NULL. Rated
In function lys_node_free() in libyang <= v1.0.225, it asserts that the value of node->module can't be NULL. Rated high
In function ext_get_plugin() in libyang <= v1.0.225, it doesn't check whether the value of revision is NULL. Rated high
A stack overflow in libyang <= v1.0.225 can cause a denial of service through function lyxml_parse_mem(). Rated high sev
In function read_yin_container() in libyang <= v1.0.225, it doesn't check whether the value of retval->ext[r] is NULL. R
In all versions of libyang before 1.0-r5, a stack-based buffer overflow was discovered in the way libyang parses YANG fi
In all versions of libyang before 1.0-r5, a stack-based buffer overflow was discovered in the way libyang parses YANG fi
Freeing the pointer returned by libyang's in-memory input helpers can hand an interior heap address to free() and abort
Heap use-after-free write in libyang before 5.2.6 enables remote authenticated attackers to crash processes or potential
Wrong-status-code handling in CESNET libyang through 6.4.13 causes ly_in_filepath() in src/in.c to report success when t
A file descriptor leak in libyang through 6.4.13 lets an attacker who can feed files into the library's by-path parsers
EUVD-2026-135440
GHSA-xxgp-q489-jhv8
NVD
CVE.org
EPSS
Exploit-DB