Wire
Wire Swift runtime: negative LENGTH_DELIMITED length in skipGroup() crashes any protobuf-decoding service
Wire provides gRPC and protocol buffers for Android, Kotlin, Swift, and Java. Prior to 6.4.1 and 7.0.0-alpha04, Wire's Swift runtime ProtoReader.skipGroup(expectedEndTag:unknownFieldsWriter:) accepts a negative length for a LENGTH_DELIMITED field inside an unknown START_GROUP field. ProtoReader.readData() forwards the negative count to ReadBuffer.readData(count:), whose upper-bound-only check permits the value to reach Foundation Data(bytes:count:) and trigger an unrecoverable process trap instead of a catchable ProtoDecoder.Error. Any Swift process decoding untrusted protobuf bytes can be crashed without authentication, user interaction, or knowledge of the target schema. This issue is fixed in versions 6.4.1 and 7.0.0-alpha04.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 6.4.1
- >= 7.0.0-alpha01, < 7.0.0-alpha04
Fixed in 6.4.1, 7.0.0-alpha04
Mitigation
Upgrade wire to 6.4.1 or 7.0.0-alpha04 or later.
References
- Vendor advisory github.com/square/wire/security/advisories/GHS…
- Patch github.com/square/wire/pull/3616
- Patch github.com/square/wire/commit/24043b6b3a5e5974…
3 more
- Patch github.com/square/wire/commit/81ff7f24a6795d9a…
- Release notes github.com/square/wire/releases/tag/6.4.1
- Release notes github.com/square/wire/releases/tag/7.0.0-alph…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.