Cap'n Proto vulnerable to out-of-bounds read due to logic error handling list-of-list.
Description
Cap'n Proto is a data interchange format and remote procedure call (RPC) system. Cap'n Proro prior to versions 0.7.1, 0.8.1, 0.9.2, and 0.10.3, as well as versions of Cap'n Proto's Rust implementation prior to 0.13.7, 0.14.11, and 0.15.2 are vulnerable to out-of-bounds read due to logic error handling list-of-list. This issue may lead someone to remotely segfault a peer by sending it a malicious message, if the victim performs certain actions on a list-of-pointer type. Exfiltration of memory is possible if the victim performs additional certain actions on a list-of-pointer type. To be vulnerable, an application must perform a specific sequence of actions, described in the GitHub Security Advisory. The bug is present in inlined code, therefore the fix will require rebuilding dependent applications. Cap'n Proto has C++ fixes available in versions 0.7.1, 0.8.1, 0.9.2, and 0.10.3. The capnp Rust crate has fixes available in versions 0.13.7, 0.14.11, and 0.15.2.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
capnpcrates.io | >= 0.15.0, < 0.15.2 | 0.15.2 |
capnpcrates.io | >= 0.14.0, < 0.14.11 | 0.14.11 |
capnpcrates.io | < 0.13.7 | 0.13.7 |
Affected products
1Patches
125d34c67863fApply data offset for list-of-pointers at access time rather than ListReader creation time.
2 files changed · +5 −5
c++/src/capnp/layout.c+++0 −4 modified@@ -2360,10 +2360,6 @@ struct WireHelpers { break; case ElementSize::POINTER: - // We expected a list of pointers but got a list of structs. Assuming the first field - // in the struct is the pointer we were looking for, we want to munge the pointer to - // point at the first element's pointer section. - ptr += tag->structRef.dataSize.get(); KJ_REQUIRE(tag->structRef.ptrCount.get() > ZERO * POINTERS, "Schema mismatch: Expected a pointer list, but got a list of data-only " "structs.") {
c++/src/capnp/layout.h+5 −1 modified@@ -1227,8 +1227,12 @@ inline Void ListReader::getDataElement<Void>(ElementCount index) const { } inline PointerReader ListReader::getPointerElement(ElementCount index) const { + // If the list elements have data sections we need to skip those. Note that for pointers to be + // present at all (which already must be true if we get here), then `structDataSize` must be a + // whole number of words, so we don't have to worry about unaligned reads here. + auto offset = structDataSize / BITS_PER_BYTE; return PointerReader(segment, capTable, reinterpret_cast<const WirePointer*>( - ptr + upgradeBound<uint64_t>(index) * step / BITS_PER_BYTE), nestingLimit); + ptr + offset + upgradeBound<uint64_t>(index) * step / BITS_PER_BYTE), nestingLimit); } // -------------------------------------------------------------------
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
15- github.com/advisories/GHSA-qqff-4vw4-f6hxghsaADVISORY
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/EAHKLUMJAXJEV5BPBS5XXWBQ3ZTHGOLY/mitrevendor-advisory
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/PTS6TWD6K2NKXLEEFBPROQXMOFUTEYWY/mitrevendor-advisory
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WKXM4JAFXLTXU5IQB3OUBQVCIICZWGYX/mitrevendor-advisory
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZOCQQOPMVQOFUWBWAGVGN76OYAV3WXY4/mitrevendor-advisory
- nvd.nist.gov/vuln/detail/CVE-2022-46149ghsaADVISORY
- dwrensha.github.io/capnproto-rust/2022/11/30/out_of_bounds_memory_access_bug.htmlghsaWEB
- github.com/capnproto/capnproto/commit/25d34c67863fd960af34fc4f82a7ca3362ee74b9ghsaWEB
- github.com/capnproto/capnproto/security/advisories/GHSA-qqff-4vw4-f6hxghsaWEB
- github.com/capnproto/capnproto/tree/master/security-advisories/2022-11-30-0-pointer-list-bounds.mdghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/EAHKLUMJAXJEV5BPBS5XXWBQ3ZTHGOLYghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PTS6TWD6K2NKXLEEFBPROQXMOFUTEYWYghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/WKXM4JAFXLTXU5IQB3OUBQVCIICZWGYXghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZOCQQOPMVQOFUWBWAGVGN76OYAV3WXY4ghsaWEB
- rustsec.org/advisories/RUSTSEC-2022-0068.htmlghsaWEB
News mentions
0No linked articles in our index yet.