Skip to content

depends, libevent: update to 2.1.13-stable - #406

Open
xanimo wants to merge 1 commit into
dogecoinfoundation:0.1.5-devfrom
xanimo:0.1.5-dev-libevent-2113
Open

depends, libevent: update to 2.1.13-stable#406
xanimo wants to merge 1 commit into
dogecoinfoundation:0.1.5-devfrom
xanimo:0.1.5-dev-libevent-2113

Conversation

@xanimo

@xanimo xanimo commented Aug 6, 2026

Copy link
Copy Markdown
Member

We ship libevent 2.1.12-stable (2020-07-05). 2.1.13-stable was released 2026-07-01 carrying seven security advisories, and libdogecoin exercises all three affected subsystems.

Module Used in Advisory
bufferevent/evbuffer net.c, rest.c GHSA-c2pj-cg4r-88c8 — dangling pointer in evbuffer_add_reference
evhttp net.c, rest.c, cli/spvnode.c GHSA-2gmv-p5m7-98p6 (trailer smuggling), GHSA-q39v-w2g7-gr8j (request smuggling), GHSA-jcwh-pvf2-73p2 (CRLF/NUL parser mismatch), GHSA-cvq5-vrvr-j338 (AF_UNIX heap OOB write, -DNDEBUG only)
evdns net.c (DNS seeds) GHSA-58rx-7448-jw47 — OOB write in dnsname_to_labels

Two more are fixed upstream in evtag/evrpc (GHSA-fj29-64w6-73h6, GHSA-45c6-qx49-89m8) which we don't use.

Unlike everything else in the current audit, this is known-vulnerable code we ship, not a hypothesis.

Both vendoring paths had to move together

  • depends/packages/libevent.mk — feeds autotools and gitian via AC_CHECK_LIB
  • src/libevent — the vendored copy CMake configures and builds in-tree

Bumping one would leave whichever half a given build used still on 2.1.12. (This is the same split #388's parity gate surfaced.)

Local delta preserved

The vendored tree was libevent's git checkout, not the release tarball, and carried exactly one local change:

-cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

2.1.13 still declares 3.1, so it's re-applied. I verified that's the only delta by diffing the old vendored tree against a pristine 2.1.12 checkout — they agreed everywhere else.

Nine files removed, not replaced

build-aux/{compile,config.guess,config.sub,depcomp,install-sh,ltmain.sh,missing,test-driver} is autoreconf output, and cmake/BuildType.cmake is an orphan present in neither the 2.1.12 tarball nor the 2.1.13 tree.

Nothing here runs autotools against the vendored copy — CMakeLists.txt drives it with cmake .. / cmake --build — and BuildType.cmake is referenced by no CMakeLists on either side. Both are dead weight, which is why the diff shows 17k deletions against 451 insertions: 28 files are the real 2.1.12→2.1.13 source delta, 0 files added.

Verification

  • The depends hash was computed from a fresh download, not copied. As a control, 2.1.12 hashes to the 92e6de1b… value already pinned — which validates the method. 2.1.13 hashes to f7e9383b8c0baa81b687e5b5eecc01beefaf1b19b64151d95ed61647fe7a315c.
  • Please confirm that against the upstream GPG signature before merging. A hash I computed from a download I made is only as good as that download, and this is a supply-chain change.
  • 0001-fix-windows-getaddrinfo.patch still applies (offset 42 lines) and is still needed — the fix hasn't landed upstream.
  • Builds and links against the new tree with WITH_NET=ON. 81/81.

Found while auditing dependency currency: there's no submodule and no pin-checking, so nothing would ever have surfaced this. Worth considering a periodic check as a follow-up — this sat four releases behind for six years.

libevent 2.1.13-stable was released 2026-07-01 and carries seven security
advisories over the 2.1.12-stable we ship, which dates from 2020-07-05.
libdogecoin exercises all three affected subsystems:

  bufferevent/evbuffer   src/net.c, src/rest.c
    GHSA-c2pj-cg4r-88c8  dangling pointer in evbuffer_add_reference

  evhttp                 src/net.c, src/rest.c, src/cli/spvnode.c
    GHSA-2gmv-p5m7-98p6  HTTP trailers permitted header smuggling
    GHSA-q39v-w2g7-gr8j  header parsing permitted request smuggling
    GHSA-jcwh-pvf2-73p2  CRLF and NUL handling allowed parser mismatch
    GHSA-cvq5-vrvr-j338  AF_UNIX heap out-of-bound write, -DNDEBUG only

  evdns                  src/net.c (DNS seeds)
    GHSA-58rx-7448-jw47  OOB write in dnsname_to_labels

Also fixed upstream: OOB read in decode_tag_internal (GHSA-fj29-64w6-73h6)
and integer overflow in evtag_unmarshal_header (GHSA-45c6-qx49-89m8), both
in evtag/evrpc, which this library does not use.

Two consumers had to move together. depends/packages/libevent.mk feeds the
autotools and gitian builds via AC_CHECK_LIB; src/libevent is the vendored
copy that CMake configures and builds in-tree. Bumping one and not the
other would leave whichever half a given build used still on 2.1.12.

The vendored tree was the libevent git checkout rather than the release
tarball, and carried exactly one local change:

    -cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
    +cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

2.1.13 still declares 3.1, so that line is re-applied. It is the only
delta -- verified by diffing the old vendored tree against a pristine
2.1.12 checkout, which agreed everywhere else.

Nine files are removed rather than replaced: build-aux/{compile,
config.guess,config.sub,depcomp,install-sh,ltmain.sh,missing,test-driver}
is autoreconf output, and cmake/BuildType.cmake is an orphan present in
neither the 2.1.12 tarball nor the 2.1.13 tree. Nothing in this repository
runs autotools against the vendored copy -- CMakeLists.txt drives it with
`cmake ..` and `cmake --build` -- and BuildType.cmake is referenced by no
CMakeLists on either side, so both are dead weight.

The depends sha256 was checked against a pristine download rather than
copied: 2.1.12 hashes to the 92e6de1b value already pinned, which confirms
the method, and 2.1.13 hashes to f7e9383b8c0baa81b687e5b5eecc01beefaf1b19
b64151d95ed61647fe7a315c. Worth confirming against the upstream GPG
signature before merge; a hash I computed from a download I made is only
as good as that download.

The depends Windows patch, 0001-fix-windows-getaddrinfo.patch, still
applies (offset 42 lines) and is still needed -- the fix has not landed
upstream.

Builds and links against the new tree with WITH_NET=ON, 81/81.
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.

1 participant