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
  1. mammix2 commented at 6:21 PM on November 5, 2020: contributor

    Update FreeType package to v2.10.4 in Depends to help mitigate against recent 0 day flaw found. See CVE-2020-15999

  2. Depends: Update FreeType package (CVE-2020-15999) efea820083
  3. DrahtBot added the label Build system on Nov 5, 2020
  4. DrahtBot added the label Docs on Nov 5, 2020
  5. 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

  6. luke-jr approved
  7. luke-jr commented at 6:30 PM on November 5, 2020: member

    utACK

    Please don't close-and-make-new PRs...

  8. mammix2 commented at 6:33 PM on November 5, 2020: contributor

    No probs, understood.

  9. MarcoFalke removed the label Docs on Nov 5, 2020
  10. MarcoFalke added the label Needs gitian build on Nov 5, 2020
  11. MarcoFalke added the label Needs Guix build on Nov 5, 2020
  12. DrahtBot commented at 6:40 PM on November 6, 2020: member

    <!--9cd9c72976c961c55c7acef8f6ba82cd-->

    Guix builds

    File commit f5cdc290d5a41895d2bbaf474c3a951e5141b8a9<br>(master) commit 83b9937bc31a63caccb92aa5d51110091d6e1743<br>(master and this pull)
    *-aarch64-linux-gnu-debug.tar.gz f0f7e524c8c5cb8f... e2d249791a196d71...
    *-aarch64-linux-gnu.tar.gz df6f5e9f91918d30... 0debfb14e22f8fca...
    *-arm-linux-gnueabihf-debug.tar.gz 235bfb8b575800e9... 0e32332ca875087c...
    *-arm-linux-gnueabihf.tar.gz 03414ac3a88ed833... 058f710360fd16c4...
    *-riscv64-linux-gnu-debug.tar.gz 35fec542f7f9a4ac... d3001f39d19ed60b...
    *-riscv64-linux-gnu.tar.gz 674e61f483e6ca37... df79bee85fe73c04...
    *-win-unsigned.tar.gz 439d1f497f80efd0... 4d459d0d7abb1536...
    *-win64-debug.zip 50cd6015a535fcbf... 58d12294a50aed93...
    *-win64-setup-unsigned.exe 9683a59409d9a314... c116fdf6ec4f3645...
    *-win64.zip 39753fbdfe0f10f6... e8c80c8729117233...
    *-x86_64-linux-gnu-debug.tar.gz 2dc2e8987c90d006... a26bcd44a4e29ebc...
    *-x86_64-linux-gnu.tar.gz f663191e51f2ef2c... 38377873a71e48c8...
    *.tar.gz f0bfcabe664ea5c9... 4de363a6278051c2...
    guix_build.log 1af6ab4b3e0f1e62... 5b1a2ea942371caa...
    guix_build.log.diff 9b7ceb7c571cb6f8...
  13. DrahtBot removed the label Needs Guix build on Nov 6, 2020
  14. DrahtBot 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...
  15. DrahtBot removed the label Needs gitian build on Nov 8, 2020
  16. MarcoFalke added this to the milestone 0.21.0 on Nov 8, 2020
  17. MarcoFalke added the label Needs gitian build on Nov 8, 2020
  18. MarcoFalke removed the label Needs gitian build on Nov 8, 2020
  19. hebasto commented at 3:51 AM on November 9, 2020: member

    From 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?

  20. fanquake removed this from the milestone 0.21.0 on Nov 9, 2020
  21. fanquake commented at 4:21 AM on November 9, 2020: member

    Why 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 .png file 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:        no
    

    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.

    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).

  22. kristapsk approved
  23. kristapsk commented at 4:42 AM on November 9, 2020: contributor

    utACK efea820083b341fc461fa2eb6fb95efe2bdfc61e. Package SHA256 hash matches the one I have on my computer, downloaded by OS package manager some time ago.

  24. laanwj commented at 8:11 AM on November 9, 2020: member

    Thanks 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)

  25. luke-jr commented at 4:19 PM on November 9, 2020: member

    In 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...

  26. mammix2 commented at 4:55 PM on November 9, 2020: contributor

    I 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.

  27. laanwj commented at 10:00 PM on November 12, 2020: member

    It's just another attack vector that is simple to mitigate with the version bump.

    Given the realizations above, how is this an attack vector?

  28. luke-jr commented at 6:16 PM on November 13, 2020: member

    I suppose it's a danger to anyone who uses depends themselves (ie, not via gitian)

    But I'm not sure why anyone would need freetype from depends?

  29. fanquake commented at 12:05 PM on November 18, 2020: member

    As mentioned above, a FreeType update was already a part of #19716, which I'll begin to split up shortly. I'll add you as a co-author in the relevant commit. Going to close this PR.

  30. fanquake closed this on Nov 18, 2020

  31. DrahtBot 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.

  32. mammix2 commented at 1:44 PM on November 18, 2020: contributor

    ok thanks.

  33. fanquake locked this on Feb 22, 2021

github-metadata-mirror

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

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me