Bug 2292351

Summary: libyaml: double-free in yaml_emitter_emit in /src/libyaml/src/emitter.c
Product: [Other] Security Response Reporter: Rohit Keshri <rkeshri>
Component: vulnerabilityAssignee: Product Security <prodsec-ir-bot>
Status: CLOSED NOTABUG QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: aprice, bdettelb, caswilli, dfreiber, dhalasz, dkuc, doconnor, drow, fjansen, hkataria, jburrell, jmitchel, jsamir, jsherril, jtanner, kaycoth, kholdawa, kshier, lbalhar, luizcosta, mhayden, mpierce, nweather, orabin, psegedy, stcannon, sthirugn, teagle, vkrizan, vkumar, vmugicag, xiaoxwan, yguenane, zzhou
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in libyaml, where it is vulnerable to a buffer overflow. This issue affects the yaml_emitter_emit function in the /src/libyaml/src/emitter.c. file, leading to a double-free problem.
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-08-02 13:19:34 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: 2292353, 2292352, 2292354, 2292355    
Bug Blocks: 2292349    

Description Rohit Keshri 2024-06-14 06:05:18 UTC
libyaml v0.2.5 is vulnerable to Buffer Overflow. Affected by this issue is the function yaml_emitter_emit of the file /src/libyaml/src/emitter.c. The manipulation leads to a double-free.

https://github.com/idhyt/pocs/blob/main/libyaml/CVE-2024-35326.c

Comment 1 Rohit Keshri 2024-06-14 06:15:52 UTC
Created R-yaml tracking bugs for this issue:

Affects: fedora-all [bug 2292354]


Created ghc-yaml tracking bugs for this issue:

Affects: epel-all [bug 2292353]


Created libyaml tracking bugs for this issue:

Affects: fedora-all [bug 2292352]


Created python-ruamel-yaml-clib tracking bugs for this issue:

Affects: fedora-all [bug 2292355]

Comment 3 Lumír Balhar 2024-07-17 07:35:33 UTC
Upstream report: https://github.com/yaml/libyaml/issues/301

Comment 4 Major Hayden 🤠 2024-08-02 13:19:34 UTC
Per the upstream developer, this involves a misuse of the underlying C API which is not necessary and not documented:

https://github.com/yaml/libyaml/issues/297#issuecomment-2161577994