Integer Overflow or Wraparound Affecting gpac4ios package, versions >=0.0.0


0.0
high

Snyk CVSS

    Attack Complexity Low
    Availability High
Expand this section
NVD
8.8 high

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-COCOAPODS-GPAC4IOS-1567336
  • published 19 Aug 2021
  • disclosed 19 Aug 2021
  • credit Cisco Talos

How to fix?

There is no fixed version for GPAC4iOS.

Overview

GPAC4iOS is a GPAC4iOS is the libgpac library packaged for iOS as a Pod. It is preconfigured and tested to do a single task: create a MP4 file from a raw H.264 and an audio track.

Affected versions of this package are vulnerable to Integer Overflow or Wraparound. The parser for an atom using the stsz FOURCC code is implemented by the following function. In this function, after verifying the FOURCC code, the number of samples is read as a 32-bit integer from the atom at line 50. After checking the number of samples against the 64-bit size, at line 52 the function will use the product of the number of samples with the size of the u32 type in order to determine how much space is to be allocated on the heap. Due to an integer overflow, this can result in the allocation returning less space than expected. At 53, when the contents of the atom is read into the array, the function will write outside the bounds of the array resulting in a heap-based buffer overflow.