CVE-2022-43254 - Memory Leak Vulnerability in GPAC v2.1-DEV-rev368-gfd054169b-master

A recently identified vulnerability, CVE-2022-43254, affects GPAC version 2.1-DEV-rev368-gfd054169b-master, a multimedia open-source tool primarily used for the processing, playback, and analysis of multimedia files. This vulnerability is a memory leak, meaning that the program repeatedly fails to free up memory correctly, leading to an eventual crash or slowdown. Specifically, the vulnerability is found within the gf_list_new component located in the file utils/list.c. In this post, we will discuss the exploit details, provide code snippets showcasing the issue, and relevant links to the original references.

Code Snippets

The vulnerability lies in the source code of GPAC in the file utils/list.c. The issue begins with the incorrect allocation of memory using the gf_list_add function, which fails to free up memory after it has been used. The code snippet below demonstrates the erroneous memory allocation:

GF_List *gf_list_new()
{
    GF_List *ptr = (GF_List *) gf_malloc(sizeof(GF_List));
    if (!ptr) {
        return NULL;
    }
    memset(ptr, , sizeof(GF_List));
    return ptr;
}

This vulnerability can be triggered by a series of malicious steps, resulting in system crashes and potential security risks. Specific details regarding the exploitation of this vulnerability are provided below in the "Exploit Details" section.

An attacker crafts a multimedia file, injecting malicious metadata or other supplementary data.

2. The victim unknowingly interacts with the malicious multimedia file using GPAC v2.1-DEV-rev368-gfd054169b-master.
3. The gf_list_new component parses the malicious input, causing an incorrect memory allocation in the gf_list_add function.
4. This repeats every time the malicious multimedia file is processed, causing a memory leak that eventually slows down or crashes the application.

Original References

- The original issue report can be found at the following GitHub page: Issue Report
- The relevant commit in the GPAC repository on GitHub that addresses this CVE: Commit gfd054169b

Mitigation

To mitigate the risks associated with CVE-2022-43254, users are advised to update their GPAC installations to the latest patched version available. Developers employing GPAC within their applications should also update the library to the patched version and recompile their applications.

The updated GPAC source code is available at the project's GitHub page: GPAC GitHub Repository

Conclusion

In summary, CVE-2022-43254 demonstrates a memory leak vulnerability affecting the GPAC v2.1-DEV-rev368-gfd054169b-master multimedia tool. The issue stems from incorrect memory allocation in the gf_list_new component at utils/list.c. By exploiting this vulnerability, an attacker can trigger a memory leak that can cause the application to slow down or crash. To mitigate the risks, users should update their GPAC installations to the patched version available on the project's GitHub page.

Timeline

Published on: 11/02/2022 14:15:00 UTC
Last modified on: 05/05/2023 20:03:00 UTC