Skip to content

Conversation

daveorourke and others added 7 commits March 19, 2019 13:17
The calculation `hdrSize - dataSize` can underflow the 64-bit unsigned int dataSize type, which can lead to incorrect results.  We throw an exception to stop the code from going any further.

Addresses https://nvd.nist.gov/vuln/detail/CVE-2018-14325
If the atom type has an embedded nul character "\x00", the loop can terminate early and return true (match) when it should return false (no match).  This function should only return true if we have reached the loop termination conditions on s2.

For example:
   // These test cases passed before and after this change
   AssertIsTrue( MP4NameFirstMatches( "sdtp", "sdtp" ) );       // Exact match
   AssertIsTrue( MP4NameFirstMatches( "trak", "trak[1]" ) );    // Matches up to [
   AssertIsTrue( MP4NameFirstMatches( "sdtp", "sdtp." ) );      // Matches up to .
   AssertIsFalse( MP4NameFirstMatches( "\x00dtp", "sdtp." ) );  // Nul character at s[0]

   // These test cases failed before this change, and pass after this change
   AssertIsFalse( MP4NameFirstMatches( "s\x00tp", "sdtp." ) );  // Nul character at s[1]
   AssertIsFalse( MP4NameFirstMatches( "sd\x00p", "sdtp." ) );  // Nul character at s[2]
   AssertIsFalse( MP4NameFirstMatches( "sdt\x00", "sdtp." ) );  // Nul character at s[3]

Addresses https://nvd.nist.gov/vuln/detail/CVE-2018-14403
If an exception occurs (because of a crafted MP4) before the value is reassigned, then a double free can occur.  By setting the pointer to NULL after the first free, we prevent the double free in this case.

Addresses: https://nvd.nist.gov/vuln/detail/CVE-2018-14054
@JacobAnderson
Copy link

👍 from me.

@daveorourke daveorourke merged commit 67cbf8d into master Mar 21, 2019
@daveorourke daveorourke deleted the securityFixes branch March 21, 2019 12:52
@daveorourke daveorourke mentioned this pull request Mar 21, 2019
stephenkwagner added a commit that referenced this pull request Mar 21, 2019
This PR updates the mac prebuilt to pull in the security fixes applied in #27.
@sergiomb2
Copy link

sergiomb2 commented Nov 2, 2019

Hello , I try maintain libmp4v2 on github [1] for Fedora packaging and in bugzilla we have lots of bugs security reports [2] .
I think we don't have fixes for CVE-2018-17236, CVE-2018-17235 and CVE-2018-7339.
HTH
Thanks.

[1]
https://github.com/sergiomb2/libmp4v2
[2]
https://bugzilla.redhat.com/buglist.cgi?component=libmp4v2

@StilgarISCA
Copy link
Contributor

Hello , I try maintain libmp4v2 on github [1] for Fedora packaging and in bugzilla we have lots of bugs security reports [2] . I think we don't have fixes for CVE-2018-17236, CVE-2018-17235 and CVE-2018-7339. HTH Thanks.

[1] https://github.com/sergiomb2/libmp4v2 [2] https://bugzilla.redhat.com/buglist.cgi?component=libmp4v2

@sergiomb2 we have been made aware of a new, maintained fork of mp4v2 which you will likely find useful for your Fedora packages: https://github.com/enzo1982/mp4v2 and https://mp4v2.org/

@sergiomb2
Copy link

yep enzo1982/mp4v2#1 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants