Closed Bug 2024039 Opened 8 months ago Closed 6 months ago

Update libexpat to version 2.8.0

Categories

(Core :: XML, task)

task

Tracking

()

RESOLVED FIXED
152 Branch
Tracking Status
firefox152 --- fixed

People

(Reporter: RyanVM, Assigned: RyanVM)

References

Details

Attachments

(3 external files)

https://github.com/libexpat/libexpat/blob/R_2_7_5/expat/Changes

Release 2.7.5 Tue March 17 2026
        Security fixes:
           #1158  CVE-2026-32776 -- Fix NULL function pointer dereference for
                    empty external parameter entities; it takes use of both
                    functions XML_ExternalEntityParserCreate and
                    XML_SetParamEntityParsing for an application to be
                    vulnerable.
     #1161 #1162  CVE-2026-32777 -- Protect from XML_TOK_INSTANCE_START
                    infinite loop in function entityValueProcessor; it takes
                    use of both functions XML_ExternalEntityParserCreate and
                    XML_SetParamEntityParsing for an application to be
                    vulnerable.
           #1163  CVE-2026-32778 -- Fix NULL dereference in function setContext
                    on retry after an earlier ouf-of-memory condition; it takes
                    use of function XML_ParserCreateNS or XML_ParserCreate_MM
                    for an application to be vulnerable.
           #1160  Three more unfixed vulnerabilities left

        Other changes:
     #1146 #1147  Autotools: Fix condition for symbol versioning check, in
                    particular when compiling with slibtool (not libtool)
           #1156  Address Cppcheck >=2.20.0 warnings
           #1153  tests: Make test_buffer_can_grow_to_max work for MinGW on
                    Ubuntu 24.04
     #1157 #1159  Version info bumped from 12:2:11 (libexpat*.so.1.11.2)
                    to 12:3:11 (libexpat*.so.1.11.3); see https://verbump.de/
                    for what these numbers do

        Infrastructure:
           #1148  CI: Fix FreeBSD and Solaris CI
           #1149  CI: Bump to WASI SDK 30
           #1153  CI: Adapt to breaking changes with Ubuntu 22.04
           #1156  CI: Adapt to breaking changes in Cppcheck

        Special thanks to:
            Berkay Eren Ürün
            Christian Ng
            Fabio Scaccabarozzi
            Francesco Bertolaccini
            Mark Brand
            Rhodri James
                 and
            AddressSanitizer
            Buttercup
            OSS-Fuzz / ClusterFuzz
            Trail of Bits

https://github.com/libexpat/libexpat/blob/R_2_8_0/expat/Changes

Release 2.8.0 Fri April 24 2026
        Security fixes:
       #47 #1183  CVE-2026-41080 -- The existing hash flooding protection
                    (based on SipHash) only used 4 to 8 bytes of entropy for
                    a salt, when 16 bytes of salt are supported by the
                    implementation of SipHash used by Expat. Now full 16 bytes
                    of entropy are used to improve protection against hash
                    flooding attacks.
                      Existing API function XML_SetHashSalt is now deprecated
                    because of its limitations, and its use should be
                    considered a vulnerability. Please either use the new API
                    function XML_SetHashSalt16Bytes (with known-high-quality
                    entropy input only!) instead, or leave the derivation of
                    a 16-bytes hash salt from high quality entropy to Expat's
                    internal machinery (by *not* calling either of the two
                    XML_SetHashSalt* functions).

        Bug fixes:
           #1188  Avoid propagating /dev/urandom file descriptor to child
                    processes
           #1193  Fix interpretation of `errno` after randomization calls
           #1195  Avoid assuming uint8_t is a character type

        Other changes:
     #1180 #1199  Add support for `getentropy(3)` as a source of entropy;
                    this helps with protecting against hash flooding attacks,
                    in particular with WASI SDK (where none of the other
                    entropy sources supported by libexpat are available).
           #1200  Autotools: Add `--without-arc4random` and
                    `--without-arc4random-buf`
           #1200  Autotools: Make `./configure` output report on available
                    high quality entropy sources
           #1173  Autotools|macOS: Sync CMake templates with CMake 4.3.0
           #1201  Autotools|CMake: Improve checks for `arc4random` and
                    `arc4random_buf` e.g. with modern glibc
           #1201  CMake: Report on availability of functions `arc4random` and
                    `arc4random_buf`
           #1201  CMake: Mark entropy related build switches as advanced
        #1189 ..
     #1203 #1204  Extract new files from entropy extraction code
           #1194  Stop duplicating C tests 1:1 as C++ ("runtests_cxx")
           #1202  Fix a comment typo in expat_external.h
           #1187  Fix grammar in compile error message
           #1192  examples: Build warning-free with -Wwrite-strings
           #1171  tests: Address harmless warning from Coverity
     #1170 #1176  Sync file headers
     #1190 #1206  Version info bumped from 12:3:11 (libexpat*.so.1.11.3)
                    to 13:0:12 (libexpat*.so.1.12.0); see https://verbump.de/
                    for what these numbers do

        Infrastructure:
  #1166 #1167 ..
  #1172 #1175 ..
  #1178 #1179 ..
     #1185 #1205  CI: Make Perl XML::Parser integration tests run against
                    both version 2.47 and the latest release 2.58
           #1169  CI: Adapt to breaking changes regarding Inno Setup
           #1173  CI: Adapt to breaking changes regarding CMake
           #1174  CI: Include public corpus of fuzzer `xml_lpm_fuzzer` with
                    regression testing
     #1181 #1182  CI: Bump WASI SDK from 30 to 32

        Special thanks to:
            Jérôme Duval
            Matthew Fernandez
Summary: Update Expat to version 2.7.5 → Update Expat to version 2.8.0

If you are going to update your patch, please make the 2.7.5 to 2.8 changes a separate patch. It is hard to figure out what is going on.

Will do. I'll attach a patch that first does the main library bump on top of our existing code, then a second one which migrates from XML_SetHashSalt to XML_SetHashSalt16Bytes per the release notes.

Also exclude the new upstream random_*.c/h entropy helper files, which
are unused in our build (we set our own hash salt via XML_SetHashSalt).

03_dont_generate_salt.patch was updated to account for upstream refactoring
generate_hash_secret_salt() to return struct sipkey and starting to call
ENTROPY_DEBUG() from outside it (in the XML_SetHashSalt paths). The patch
now stubs ENTROPY_DEBUG's body rather than #if-0ing the whole function, and
wraps the relocated entropy helpers accordingly.

Upstream deprecated XML_SetHashSalt in Expat 2.8.0 (CVE-2026-41080)
because it only carries 4-8 bytes of entropy into what is a 128-bit
SipHash salt. Switch to XML_SetHashSalt16Bytes, which takes a full
16 bytes, and feed it with GenerateRandomBytesFromOS. Also drop the
now-unused MOZ_XML_SetHashSalt wrapper and update the comments in
03_dont_generate_salt.patch to match.

The wrapper takes const char[16] rather than const uint8_t[16] so the
buffer can be transferred through RLBox's sandbox boundary, which only
permits memcpy of char/short/wchar_t/char16_t/float/double.

Summary: Update Expat to version 2.8.0 → Update libexpat to version 2.8.0
Attachment #9553877 - Attachment description: Bug 2024039 - Update Expat to version 2.7.5. r=mccr8 → Bug 2024039 - Update libexpat to version 2.7.5. r=mccr8
Attachment #9573635 - Attachment description: Bug 2024039 - Update Expat to version 2.8.0. r=mccr8 → Bug 2024039 - Update libexpat to version 2.8.0. r=mccr8
Attachment #9573636 - Attachment description: Bug 2024039 - Use XML_SetHashSalt16Bytes for 128-bit expat hash salt entropy. r=mccr8 → Bug 2024039 - Use XML_SetHashSalt16Bytes for 128-bit libexpat hash salt entropy. r=mccr8
Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch
Regressions: 2035137
Blocks: 2038532
QA Whiteboard: [qa-triage-done-c153/b152]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: