CVE-2026-61695: Wire Swift runtime: negative LENGTH_DELIMITED length in skipGroup() crashes any protobuf-decoding service
Wire’s Swift runtime (Wire SPM/CocoaPods product, implemented by
wire-runtime-swift) did not reject a negative LENGTH_DELIMITED field length
while skipping an unknown protobuf group. A crafted 10-byte protobuf payload
could cause ProtoReader.skipGroup() to read a length-delimited field whose
varint decodes to a negative Int32. That negative value was then passed to
ReadBuffer.readData(count:).
ReadBuffer checked only that the requested read did not go past the end of
the buffer. It did not reject negative counts. As a result, a negative count
could pass the bounds check and reach Foundation’s Data(bytes:count:), which
traps and aborts the process (Signal 5 / SIGTRAP) instead of throwing Wire’s
documented ProtoDecoder.Error.
This is the Swift sibling of the Kotlin/JVM negative-length-in-skipGroup()
issue fixed in com.squareup.wire:wire-runtime 6.3.0
(CVE-2026-45799, GHSA-7xpr-hc2w-34m9). That earlier fix added a
length < 0 rejection to the Kotlin readers. The functionally similar Swift
ProtoReader.skipGroup() path was not covered by that fix and remained
vulnerable in released Swift runtime versions through 6.4.0, and in Wire 7
alpha releases through 7.0.0-alpha03.
The issue is fixed for the supported 6.x release line in Wire 6.4.1.
skipGroup() runs for any unknown field with wire type 3 (START_GROUP), so
no schema knowledge is required. A service decoding any message type with
ProtoDecoder.decode(_:from:) over untrusted bytes can be reached by sending an
unknown group field.
References
- github.com/advisories/GHSA-86wm-r4c5-2rc9
- github.com/square/wire/commit/24043b6b3a5e5974a978f2745b76d50b31407c1c
- github.com/square/wire/commit/81ff7f24a6795d9a8be2e03f272b2d979a5d2c7e
- github.com/square/wire/pull/3616
- github.com/square/wire/releases/tag/6.4.1
- github.com/square/wire/releases/tag/7.0.0-alpha04
- github.com/square/wire/security/advisories/GHSA-86wm-r4c5-2rc9
- nvd.nist.gov/vuln/detail/CVE-2026-61695
Detect and mitigate CVE-2026-61695 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →