CVE-2021-28902

7.5 HIGH

📋 TL;DR

This vulnerability in libyang's read_yin_container() function allows a NULL pointer dereference when processing certain YANG data models. It affects systems using libyang v1.0.225 and earlier for network configuration management. Exploitation causes application crashes, potentially disrupting network management operations.

💻 Affected Systems

Products:
  • libyang
  • systems using libyang library
Versions: libyang <= v1.0.225
Operating Systems: Linux, Unix-like systems
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability triggers when processing specific YANG data models through the affected function.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Denial of service causing network management system failure, potentially disrupting configuration updates and monitoring across managed devices.

🟠

Likely Case

Application crash when processing malformed YANG data, requiring service restart and temporary loss of network configuration capabilities.

🟢

If Mitigated

Controlled crash with minimal impact if proper monitoring and restart mechanisms are in place.

🌐 Internet-Facing: MEDIUM - Only affects systems exposing libyang functionality via network interfaces, typically in management applications.
🏢 Internal Only: MEDIUM - Affects internal network management systems that process YANG data from various sources.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Requires ability to feed malformed YANG data to the vulnerable function, typically through configuration interfaces.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: libyang v1.0.226 and later

Vendor Advisory: https://github.com/CESNET/libyang/issues/1454

Restart Required: Yes

Instructions:

1. Update libyang to version 1.0.226 or later. 2. Recompile applications using libyang. 3. Restart affected services.

🔧 Temporary Workarounds

Input validation

all

Validate YANG data inputs before processing through libyang functions

🧯 If You Can't Patch

  • Restrict access to configuration interfaces that accept YANG data
  • Implement monitoring and automatic restart for libyang-based services

🔍 How to Verify

Check if Vulnerable:

Check libyang version: ldd --version | grep libyang or check package manager

Check Version:

pkg-config --modversion libyang

Verify Fix Applied:

Verify libyang version >= 1.0.226 and test with known problematic YANG data

📡 Detection & Monitoring

Log Indicators:

  • Segmentation fault logs from libyang processes
  • Unexpected service restarts of network management applications

Network Indicators:

  • Unusual YANG data submissions to management interfaces

SIEM Query:

process.name: "*libyang*" AND event.type: "segmentation_fault"

🔗 References

📤 Share & Export