package/taglib: fix CVE-2017-12678
PATCH 1/2 package/taglib: fix CVE-2017-12678
In TagLib 1.11.1, the rebuildAggregateFrames function in id3v2framefactory.cpp has a pointer to cast vulnerability, which allows remote attackers to cause a denial of service or possibly have unspecified other impact via a crafted audio file.
--- ...-instance-of-TextIdentificationFrame.patch | 33 +++++++++++++++++++ package/taglib/taglib.mk | 3 ++ 2 files changed, 36 insertions(+) create mode 100644 package/taglib/0002-Don-t-assume-TDRC-is-an-instance-of-TextIdentificationFrame.patch
package/taglib/0002-Don-t-assume-TDRC-is-an-instance-of-TextIdentificationFrame.patch new file +33 -0
@@ -0,0 +1,33 @@ +From eb9ded1206f18f2c319157337edea2533a40bea6 Mon Sep 17 00:00:00 2001 +From: "Stephen F. Booth" <[email protected]> +Date: Sun, 23 Jul 2017 10:11:09 -0400 +Subject: [PATCH] Don't assume TDRC is an instance of TextIdentificationFrame + +If TDRC is encrypted, FrameFactory::createFrame() returns UnknownFrame +which causes problems in rebuildAggregateFrames() when it is assumed +that TDRC is a TextIdentificationFrame +[Retrieved from: +https://github.com/taglib/taglib/pull/831/commits/eb9ded1206f18f2c319157337edea2533a40bea6] +Signed-off-by: Fabrice Fontaine <[email protected]> +--- + taglib/mpeg/id3v2/id3v2framefactory.cpp | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/taglib/mpeg/id3v2/id3v2framefactory.cpp b/taglib/mpeg/id3v2/id3v2framefactory.cpp +index 759a9b7be..9347ab869 100644 +--- a/taglib/mpeg/id3v2/id3v2framefactory.cpp ++++ b/taglib/mpeg/id3v2/id3v2framefactory.cpp +@@ -334,10 +334,11 @@ void FrameFactory::rebuildAggregateFrames(ID3v2::Tag *tag) const + tag->frameList("TDAT").size() == 1) + { + TextIdentificationFrame *tdrc = +- static_cast<TextIdentificationFrame *>(tag->frameList("TDRC").front()); ++ dynamic_cast<TextIdentificationFrame *>(tag->frameList("TDRC").front()); + UnknownFrame *tdat = static_cast<UnknownFrame *>(tag->frameList("TDAT").front()); + +- if(tdrc->fieldList().size() == 1 && ++ if(tdrc && ++ tdrc->fieldList().size() == 1 && + tdrc->fieldList().front().size() == 4 && + tdat->data().size() >= 5) + {
package/taglib/taglib.mk +3 -0
@@ -10,6 +10,9 @@ TAGLIB_INSTALL_STAGING = YES TAGLIB_LICENSE = LGPL-2.1 or MPL-1.1 TAGLIB_LICENSE_FILES = COPYING.LGPL COPYING.MPL +# 0002-Don-t-assume-TDRC-is-an-instance-of-TextIdentificationFrame.patch +TAGLIB_IGNORE_CVES += CVE-2017-12678 + ifeq ($(BR2_PACKAGE_ZLIB),y) TAGLIB_DEPENDENCIES += zlib endif
Signature · 1 line
2.25.0
PATCH 2/2 package/taglib: fix CVE-2018-11439
The TagLib::Ogg::FLAC::File::scan function in oggflacfile.cpp in TagLib 1.11.1 allows remote attackers to cause information disclosure (heap-based buffer over-read) via a crafted audio file.
--- ...d-when-loading-invalid-ogg-flac-file.patch | 45 +++++++++++++++++++ package/taglib/taglib.mk | 3 ++ 2 files changed, 48 insertions(+) create mode 100644 package/taglib/0003-Fixed-OOB-read-when-loading-invalid-ogg-flac-file.patch
package/taglib/0003-Fixed-OOB-read-when-loading-invalid-ogg-flac-file.patch new file +45 -0
@@ -0,0 +1,45 @@ +From 2c4ae870ec086f2ddd21a47861a3709c36faac45 Mon Sep 17 00:00:00 2001 +From: Scott Gayou <[email protected]> +Date: Tue, 9 Oct 2018 18:46:55 -0500 +Subject: [PATCH] Fixed OOB read when loading invalid ogg flac file. (#868) + (#869) + +CVE-2018-11439 is caused by a failure to check the minimum length +of a ogg flac header. This header is detailed in full at: +https://xiph.org/flac/ogg_mapping.html. Added more strict checking +for entire header. +[Retrieved from: +https://github.com/taglib/taglib/commit/2c4ae870ec086f2ddd21a47861a3709c36faac45] +Signed-off-by: Fabrice Fontaine <[email protected]> +--- + taglib/ogg/flac/oggflacfile.cpp | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/taglib/ogg/flac/oggflacfile.cpp b/taglib/ogg/flac/oggflacfile.cpp +index 53d04508a..07ea9dccc 100644 +--- a/taglib/ogg/flac/oggflacfile.cpp ++++ b/taglib/ogg/flac/oggflacfile.cpp +@@ -231,11 +231,21 @@ void Ogg::FLAC::File::scan() + + if(!metadataHeader.startsWith("fLaC")) { + // FLAC 1.1.2+ ++ // See https://xiph.org/flac/ogg_mapping.html for the header specification. ++ if(metadataHeader.size() < 13) ++ return; ++ ++ if(metadataHeader[0] != 0x7f) ++ return; ++ + if(metadataHeader.mid(1, 4) != "FLAC") + return; + +- if(metadataHeader[5] != 1) +- return; // not version 1 ++ if(metadataHeader[5] != 1 && metadataHeader[6] != 0) ++ return; // not version 1.0 ++ ++ if(metadataHeader.mid(9, 4) != "fLaC") ++ return; + + metadataHeader = metadataHeader.mid(13); + }
package/taglib/taglib.mk +3 -0
@@ -13,6 +13,9 @@ TAGLIB_LICENSE_FILES = COPYING.LGPL COPYING.MPL # 0002-Don-t-assume-TDRC-is-an-instance-of-TextIdentificationFrame.patch TAGLIB_IGNORE_CVES += CVE-2017-12678 +# 0003-Fixed-OOB-read-when-loading-invalid-ogg-flac-file.patch +TAGLIB_IGNORE_CVES += CVE-2018-11439 + ifeq ($(BR2_PACKAGE_ZLIB),y) TAGLIB_DEPENDENCIES += zlib endif
Signature · 1 line
2.25.0
PATCH 2/2 package/taglib: fix CVE-2018-11439
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Fabrice" == Fabrice Fontaine <[email protected]> writes:
The
TagLib::Ogg::FLAC::File::scanfunction in oggflacfile.cpp in TagLib 1.11.1 allows remote attackers to cause information disclosure (heap-based buffer over-read) via a crafted audio file.Signed-off-by Fabrice Fontaine <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 2/2 package/taglib: fix CVE-2018-11439
In reply to Fabrice FontaineQuoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Fabrice" == Fabrice Fontaine <[email protected]> writes:
The
TagLib::Ogg::FLAC::File::scanfunction in oggflacfile.cpp in TagLib 1.11.1 allows remote attackers to cause information disclosure (heap-based buffer over-read) via a crafted audio file.Signed-off-by Fabrice Fontaine <[email protected]>
Committed to 2019.02.x and 2019.11.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/2 package/taglib: fix CVE-2017-12678
In reply to Fabrice FontaineQuoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Fabrice" == Fabrice Fontaine <[email protected]> writes:
In TagLib 1.11.1, the rebuildAggregateFrames function in id3v2framefactory.cpp has a pointer to cast vulnerability, which allows remote attackers to cause a denial of service or possibly have unspecified other impact via a crafted audio file.
Signed-off-by Fabrice Fontaine <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/2 package/taglib: fix CVE-2017-12678
In reply to Fabrice FontaineQuoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Fabrice" == Fabrice Fontaine <[email protected]> writes:
In TagLib 1.11.1, the rebuildAggregateFrames function in id3v2framefactory.cpp has a pointer to cast vulnerability, which allows remote attackers to cause a denial of service or possibly have unspecified other impact via a crafted audio file.
Signed-off-by Fabrice Fontaine <[email protected]>
Committed to 2019.02.x and 2019.11.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard