Skip to main content

CESNET libyang CVE-2026-136907

| EUVDEUVD-2026-135438 MEDIUM
Return of Wrong Status Code (CWE-393)
2026-11-25 VulnCheck GHSA-3fmm-4mh3-vx58
6.3
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Access
    Influence reused libyang input handler
  2. Exploit
    Point handler at nonexistent or empty file
  3. Execution
    ly_in_filepath() returns false success
  4. Impact
    Application parses previously loaded file's data as requested input

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V16 - Security Logging and Error Handling Return value error handling
Exploitation Conditions

Exploitation requires an application built on libyang that reuses a single struct ly_in input handler across multiple ly_in_filepath() calls AND that lets an attacker cause one such call to target a nonexistent or empty file (the path need only be attacker-influenced, not attacker-written). Under those conditions ly_in_filepath() incorrectly reports success when the new file cannot be opened or mmap'd, so the handler retains the prior file's mapped data and subsequent parsing operates on that stale data. Limiting factors: it is NOT exploitable against ordinary single-use parsing; it depends on the specific handler-reuse code path, on attacker influence over the switched filepath, and on the application trusting the return status - which is why the supplied vector uses AC:H and AT:P. No authentication is required per PR:N, but the preconditions, not privileges, are the real gate.

Impact

This is a medium-severity logic flaw (CWE-393, return of wrong status code), and the signals collectively point to a real-but-non-urgent issue rather than a top priority. The supplied CVSS 4.0 vector (AV:N/AC:H/AT:P/PR:N/UI:N) pairs a network vector and no required privileges with HIGH attack complexity and a present attack requirement (AT:P), which correctly reflects that exploitation is not simple or self-contained - it depends on a specific application usage pattern, not a default-config remote hit. Impact is bounded (VC:L/VI:L, VA:N), consistent with an application parsing the wrong (stale) input rather than a code-execution or full-disclosure outcome. The vuln.today decision label is 'this_month' (not act_now/emergency), there is no CISA KEV listing and no EPSS score in the supplied data, and no PoC/exploit reference is provided - only an issue report, the fix commit, a source-line pointer, and a VulnCheck advisory. Net assessment: patch within the normal cycle; this is a correctness/trust-of-input weakness in a library, meaningful for anything that reuses an input handler, but it is not a widespread-exploitation emergency. Missing data to note explicitly: EPSS and KEV status are absent from the input (treat as not-listed, not as confirmed-safe), and real-world impact depends entirely on how downstream applications use libyang's input handlers.

Exploit ScenarioDerived

An application that reuses a single libyang input handler (struct ly_in) across multiple parse operations is induced to switch that handler to a nonexistent or empty file whose path the attacker can influence. Because ly_in_filepath() returns success even though the new file could not be opened or mmap'd, the handler still points at the previously loaded file's data, so the application parses the old file's content as if it were the newly requested input - producing wrong configuration/data decisions. No public working exploit is identified; given AC:H/AT:P, triggering requires the specific handler-reuse pattern rather than a generic remote payload.

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

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

Alert me

AnalysisAIv1 – Nov 25, 2026

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.

RemediationAI

Apply the upstream fix commit ed9b84f325fb88e1aa467417222c5f0d0ab51fb0 or deploy a libyang release that contains it; the provided data confirms an upstream fix but does not name a tagged release, so verify the commit is present in the version you ship rather than assuming a version number (issue tracking at https://github.com/CESNET/libyang/issues/2598, vendor advisory at https://www.vulncheck.com/advisories/libyang-through-6.4.13-wrong-status-code-in-ly-in-filepath). Applications that cannot rebuild against the fix should avoid reusing one struct ly_in across different files, reinitialize or revalidate the handler after every filepath switch, and audit every ly_in_filepath() call site to treat ((void *)-1) - and, for unpatched builds, a NULL return on the failing path - as fatal, aborting the parse instead of continuing with stale data; note that call sites which only test for NULL must be updated once the fixed version is adopted, otherwise the new sentinel will be misread as success. These workarounds reduce exposure only in code paths you control and do not correct the library-level status-code bug, so upgrading remains the complete fix.

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 a C library for parsing and validating YANG schemas and instance data. Its struct ly_in input abstraction wraps file descriptors, files and memory buffers; ly_in_new_filepath()/ly_in_filepath() open the target and mmap it, then set in->type to LY_IN_FILEPATH. The flaw is CWE-393 (return of wrong status code): the pre-fix code used an inverted/incorrect fd check (LY_CHECK_ERR_RET(!fd, ...)) and returned NULL where a distinct error sentinel was needed, so a file that could not be opened or mapped was reported as success while the handler still pointed at the prior mmap'd contents. The upstream patch (commit ed9b84f325fb88e1aa467417222c5f0d0ab51fb0) changes the guard to fd == -1, returns ((void *)-1) on failure instead of NULL, adds a missing close(fd) on the ly_in_new_fd error path and on the early-return path to fix an fd leak, and extends tests/utests/basic/test_inout.c with assertions that a missing or empty file is an error and that the handler retains (but does not silently misreport) its previous file. Because the error sentinel changed, callers written against the old NULL return need to be updated to test for ((void *)-1).

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:L/VA:N/SC:N/SI:N/SA:N
vuln.today AI 4.8 MEDIUM

Network-reachable via a reused handler but gated by a specific application reuse pattern and attacker-influenced path (AC:H), no privileges (PR:N); impact limited to parsing stale data (C:L/I:L, A:N).

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:L/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
Low
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 a return of wrong status code vulnerability in ly_in_filepath() in src/in.c that reports success when a new file cannot be opened or mapped. Attackers who make an application switch a reused input handler to a nonexistent or empty file cause it to parse the previously loaded file's data as the requested input.

Threat Intelligence Overview

EPSS Score
0.6%
Top 55% exploitable
Prevalence
Medium
YANG parsing library embedded in network-management tooling (sysrepo, FRRouting, Netopeer), not universal
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High

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.6%
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
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

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-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

CVE-2026-136905 MEDIUM
6.3 Nov 25

In CESNET libyang through 6.4.13, ly_out_reset() in src/out.c rewinds a seekable output target but can skip the accompan

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