Bug 1779576 (CVE-2019-19334) - CVE-2019-19334 libyang: stack-based buffer overflow in make_canonical when identityref leaf type is used
Summary: CVE-2019-19334 libyang: stack-based buffer overflow in make_canonical when id...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2019-19334
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1780312 1780313 1780494
Blocks: 1778852
TreeView+ depends on / blocked
 
Reported: 2019-12-04 09:50 UTC by Riccardo Schirone
Modified: 2021-02-16 20:56 UTC (History)
3 users (show)

Fixed In Version: libyang 1.0-r5
Doc Type: ---
Doc Text:
A stack-based buffer overflow flaw was discovered in the way libyang parses YANG files with a leaf of type "identityref". An application that uses libyang to parse untrusted YANG files may be vulnerable to this flaw, which would allow an attacker to cause a denial of service or execute code.
Clone Of:
Environment:
Last Closed: 2019-12-23 14:09:52 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:4360 0 None None None 2019-12-23 03:56:46 UTC

Description Riccardo Schirone 2019-12-04 09:50:44 UTC
libyang up to version 1 release 4 has a stack-based buffer overflow in function make_canonical() in parser.c, when dealing with "identityref" types with a name longer than 511 bytes. An application that uses libyang to validate untrusted YANG files could be vulnerable to this flaw, which could be used by an attacker to cause a denial of service or possibly gain code execution.

Comment 1 Riccardo Schirone 2019-12-04 09:50:47 UTC
Acknowledgments:

Name: Riccardo Schirone (Red Hat Product Security)

Comment 5 Riccardo Schirone 2019-12-05 16:39:23 UTC
An application that parses untrusted YANG files could be vulnerable to this flaw. To trigger this flaw, a YANG module should have a leaf with type "identityref" and a default value longer than 511 bytes, which would cause a stack-based buffer overflow in make_canonical(), due to the insecure use of strcpy/sprintf without any check.

Comment 7 Riccardo Schirone 2019-12-06 07:56:16 UTC
Created libyang tracking bugs for this issue:

Affects: fedora-all [bug 1780494]

Comment 9 errata-xmlrpc 2019-12-23 03:56:45 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2019:4360 https://access.redhat.com/errata/RHSA-2019:4360

Comment 10 Product Security DevOps Team 2019-12-23 14:09:52 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2019-19334


Note You need to log in before you can comment on or make changes to this bug.