@@ -12,8 +12,29 @@ endif()
1212
1313include ("cmake/compat_find.cmake" )
1414
15- find_package (CapnProto 0.7.0 REQUIRED)
1615find_package (Threads REQUIRED)
16+ find_package (CapnProto 0.7 REQUIRED)
17+
18+ # Check for list-of-pointers memory access bug from Nov 2022
19+ # https://nvd.nist.gov/vuln/detail/CVE-2022-46149
20+ # https://github.com/advisories/GHSA-qqff-4vw4-f6hx
21+ # https://github.com/capnproto/capnproto/security/advisories/GHSA-qqff-4vw4-f6hx
22+ # https://github.com/capnproto/capnproto/blob/master/security-advisories/2022-11-30-0-pointer-list-bounds.md
23+ # https://capnproto.org/news/2022-11-30-CVE-2022-46149-security-advisory.html
24+ # https://dwrensha.github.io/capnproto-rust/2022/11/30/out_of_bounds_memory_access_bug.html
25+ if (CapnProto_VERSION STREQUAL "0.7.0"
26+ OR CapnProto_VERSION STREQUAL "0.8.0"
27+ OR CapnProto_VERSION STREQUAL "0.9.0"
28+ OR CapnProto_VERSION STREQUAL "0.9.1"
29+ OR CapnProto_VERSION STREQUAL "0.10.0"
30+ OR CapnProto_VERSION STREQUAL "0.10.1"
31+ OR CapnProto_VERSION STREQUAL "0.10.2" )
32+ message (FATAL_ERROR
33+ "Cap'n Proto ${CapnProto_VERSION} is affected by CVE-2022-46149.\n "
34+ "Please install an updated package.\n "
35+ "Details: https://github.com/advisories/GHSA-qqff-4vw4-f6hx
36+ " )
37+ endif ()
1738
1839set (MPGEN_EXECUTABLE "" CACHE FILEPATH "If specified, should be full path to an external mpgen binary to use rather than the one built internally." )
1940
0 commit comments