Update FreeType package to v2.10.4 in Depends to help mitigate against recent 0 day flaw found. See CVE-2020-15999
Depends: Update FreeType package (CVE-2020-15999) #20320
pull mammix2 wants to merge 1 commits into bitcoin:master from mammix2:master changing 2 files +4 −4-
mammix2 commented at 6:21 PM on November 5, 2020: contributor
-
Depends: Update FreeType package (CVE-2020-15999) efea820083
- DrahtBot added the label Build system on Nov 5, 2020
- DrahtBot added the label Docs on Nov 5, 2020
-
in depends/packages/freetype.mk:5 in efea820083
0 | @@ -1,8 +1,8 @@ 1 | package=freetype 2 | -$(package)_version=2.7.1 3 | +$(package)_version=2.10.4 4 | $(package)_download_path=https://download.savannah.gnu.org/releases/$(package) 5 | -$(package)_file_name=$(package)-$($(package)_version).tar.bz2 6 | -$(package)_sha256_hash=3a3bb2c4e15ffb433f2032f50a5b5a92558206822e22bfe8cbe339af4aa82f88 7 | +$(package)_file_name=$(package)-$($(package)_version).tar.xz 8 | +$(package)_sha256_hash=86a854d8905b19698bbc8f23b860bc104246ce4854dcea8e3b0fb21284f75784
luke-jr commented at 6:29 PM on November 5, 2020:This matches what I've had on my system since 2020-10-20
luke-jr approvedluke-jr commented at 6:30 PM on November 5, 2020: memberutACK
Please don't close-and-make-new PRs...
mammix2 commented at 6:33 PM on November 5, 2020: contributorNo probs, understood.
MarcoFalke removed the label Docs on Nov 5, 2020MarcoFalke added the label Needs gitian build on Nov 5, 2020MarcoFalke added the label Needs Guix build on Nov 5, 2020DrahtBot commented at 6:40 PM on November 6, 2020: member<!--9cd9c72976c961c55c7acef8f6ba82cd-->
Guix builds
DrahtBot removed the label Needs Guix build on Nov 6, 2020DrahtBot commented at 12:54 AM on November 8, 2020: member<!--a722867cd34abeea1fadc8d60700f111-->
Gitian builds
File commit 7e373294a5ae819099c39d9d03d1f5a311d63cfc<br>(master) commit c52aeca821f35a39f35929bf9a9b7b94d9d7a07a<br>(master and this pull) *-osx-unsigned.dmg 8881d819b5a03e1d...a41adea4dc0ba94c...*-osx64.tar.gz bcf7429bd9891ff3...196e57971c24ebb0...*-win64-debug.zip 7f60cd29a7864522...e99b2e55e30d6141...*-win64-setup-unsigned.exe c081d7eedbe5b1a7...24b4793b4fbb01d1...*-win64.zip ac8172f935e15a54...fd450c8119ef6544...*.tar.gz 807305e2b5af4d43...2151d942f263c423...bitcoin-core-osx-0.21-res.yml fd78e44ed71f58c1...9d6e1bb4e5a1b062...bitcoin-core-win-0.21-res.yml 4a771363df3a69a7...1800017a8ca6f59b...linux-build.log 60783f23cde5efd7...40fbf5422fa95008...osx-build.log 906bb37b69cf3ef3...d86c2e31572dd970...win-build.log a643a56926f8f128...330e93a1a5fba17f...*-aarch64-linux-gnu-debug.tar.gz 8b828447587ecce5...*-aarch64-linux-gnu.tar.gz 6250792e603f97c0...*-arm-linux-gnueabihf-debug.tar.gz d0441c2634b9f9b8...*-arm-linux-gnueabihf.tar.gz ca58fb1237fbd84d...*-riscv64-linux-gnu-debug.tar.gz d1534f0cfeeeb9ba...*-riscv64-linux-gnu.tar.gz 4df2f42d2f911f47...*-x86_64-linux-gnu-debug.tar.gz 32ba1a6cf37867a2...*-x86_64-linux-gnu.tar.gz a5c6cf24141503aa...bitcoin-core-linux-0.21-res.yml 00aa546ccbf0bed5...bitcoin-core-osx-0.21-res.yml.diff 8e6e9991b5dff39c...bitcoin-core-win-0.21-res.yml.diff 0f760f1c6242d403...linux-build.log.diff d7486febaab11dff...osx-build.log.diff 1eb7e52126f9c17f...win-build.log.diff 8cfa0c18d27004a0...DrahtBot removed the label Needs gitian build on Nov 8, 2020MarcoFalke added this to the milestone 0.21.0 on Nov 8, 2020MarcoFalke added the label Needs gitian build on Nov 8, 2020MarcoFalke removed the label Needs gitian build on Nov 8, 2020hebasto commented at 3:51 AM on November 9, 2020: memberFrom CVE-2020-15999 description:
Heap buffer overflow in Freetype in Google Chrome prior to 86.0.4240.111 allowed a remote attacker to potentially exploit heap corruption via a crafted HTML page.
So I'm wondering what is the scenario to exploit that vulnerability when running
bitcoin-qt? @MarcoFalke Why 0.21.0 milestone added? Is it error prone to change dependency package at the last moment before branching-off?fanquake removed this from the milestone 0.21.0 on Nov 9, 2020fanquake commented at 4:21 AM on November 9, 2020: memberWhy 0.21.0 milestone added? Is it error prone to change dependency package at the last moment before branching-off?
I'm not sure, however there's not really a rush to update this just before a branch-off, and as far as I'm aware, there's no way to "use" this exploit with
bitcoin-qt. It requires loading a specially crafted font, which has a.pngfile embedded inside it, and taking advantage of a buffer overflow thereafter. An exploit like this is obviously easier to use in a web browser, where pages can load arbitrary resources, like fonts.Note that when we compile FreeType in depends we also explicitly disable png support, so for depends (release) builds we shouldn't even be compiling the affected code (
Load_SBit_Png). If you look in the Linux depends output for Freetype you should see:Library configuration: external zlib: no bzip2: no libpng: noWe also currently load
libfreetype.soat runtime, so if anything, an end-user should make sure that the version of libfreetype on their system is updated.I'm fine for us to update FreeType post branch off as part of #19716 (I'd already included an update there, although it's currently just to 2.10.2).
kristapsk approvedkristapsk commented at 4:42 AM on November 9, 2020: contributorutACK efea820083b341fc461fa2eb6fb95efe2bdfc61e. Package SHA256 hash matches the one I have on my computer, downloaded by OS package manager some time ago.
laanwj commented at 8:11 AM on November 9, 2020: memberThanks for the investigation @fanquake .
Note that when we compile FreeType in depends we also explicitly disable png support, so for depends (release) builds we shouldn't even be compiling the affected code (Load_SBit_Png). If you look in the Linux depends output for Freetype you should see:
OK, so we don't compile the vulnerable code at all.
We also currently load libfreetype.so at runtime, so if anything, an end-user should make sure that the version of libfreetype on their system is updated.
Oh, right!!! this is one of the libraries that we only compile as an interface to a system shared library. We don't actually use any code from depends except the headers really. This would be something where TBD stubs would be better:
/tmp/x/bitcoin-0.20.0/bin$ readelf -d ./bitcoin-qt |grep NEEDED 0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0] 0x0000000000000001 (NEEDED) Shared library: [librt.so.1] 0x0000000000000001 (NEEDED) Shared library: [libfontconfig.so.1] 0x0000000000000001 (NEEDED) Shared library: [libfreetype.so.6] <----------------------------------- 0x0000000000000001 (NEEDED) Shared library: [libxcb.so.1] 0x0000000000000001 (NEEDED) Shared library: [libdl.so.2] 0x0000000000000001 (NEEDED) Shared library: [libm.so.6] 0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1] 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x0000000000000001 (NEEDED) Shared library: [ld-linux-x86-64.so.2]So it is sufficient if users upgrade their system package. Which they really should, but not so much because of bitcoin core.
Agree with removing it from the milestone.
(It still makes sense to bump this package at some point but there is no hurry)
luke-jr commented at 4:19 PM on November 9, 2020: memberIn that case (we don't ship the built lib at all), it may be better to leave it at an older version simply to avoid any compatibility surprises...
mammix2 commented at 4:55 PM on November 9, 2020: contributorI would say that If there are no compatibility issues flagged on the Bitcoin release processes to include 2.10.4, then that mitigates the CVE easily and should be merged in a future milestone / release, and also from end users or developers fiddling with depends compilation switches. It's just another attack vector that is simple to mitigate with the version bump.
laanwj commented at 10:00 PM on November 12, 2020: memberIt's just another attack vector that is simple to mitigate with the version bump.
Given the realizations above, how is this an attack vector?
luke-jr commented at 6:16 PM on November 13, 2020: memberI suppose it's a danger to anyone who uses
dependsthemselves (ie, not via gitian)But I'm not sure why anyone would need freetype from depends?
fanquake closed this on Nov 18, 2020DrahtBot commented at 12:08 PM on November 18, 2020: member<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #20413 (build: Require C++17 compiler by MarcoFalke)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
mammix2 commented at 1:44 PM on November 18, 2020: contributorok thanks.
fanquake locked this on Feb 22, 2021
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:14 UTC
More mirrored repositories can be found on mirror.b10c.me