Bug 1964012 (CVE-2021-28904)

Summary: CVE-2021-28904 libyang: NULL pointer dereference in ext_get_plugin()
Product: [Other] Security Response Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: mruprich, tkorbar
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libyang 1.0.225 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in libyang. A NULL pointer dereference in ext_get_plugin function allows a remote attacker to crash an application that uses libyang with user-controlled YANG data. The highest threat from this vulnerability is the service availability.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-28 12:28:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1964013, 1965256, 1965257    
Bug Blocks: 1964021    

Description Guilherme de Almeida Suckevicz 2021-05-24 14:41:36 UTC
In function ext_get_plugin() in libyang <= v1.0.225, it doesn't check whether the value of revision is NULL. If revision is NULL, the operation of strcmp(revision, ext_plugins[u].revision) will lead to a crash.

Reference:
https://github.com/CESNET/libyang/issues/1451

Comment 1 Guilherme de Almeida Suckevicz 2021-05-24 14:41:54 UTC
Created libyang tracking bugs for this issue:

Affects: fedora-all [bug 1964013]

Comment 2 Riccardo Schirone 2021-05-27 09:39:01 UTC
Upstream patch:
https://github.com/CESNET/libyang/commit/59a0bff1a5a2f0a0eac07e4bf94d4aea9dd3708d