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


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.22% (62nd percentile)

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 IDSNYK-COCOAPODS-GPAC4IOS-1567336
  • published19 Aug 2021
  • disclosed19 Aug 2021
  • creditCisco Talos

Introduced: 19 Aug 2021

CVE-2021-21846  (opens in a new tab)
CWE-190  (opens in a new tab)

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.

CVSS Scores

version 3.1