Wire: skipGroup() missing negative-length check allows 10-byte payload to crash any Wire-decoding service
square wire
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| com.squareup.wire:wire-runtime-jvm Maven |
|
|
| com.squareup.wire:wire-runtime Maven |
|
square wire
| Product | Affected | Fixed in |
|---|---|---|
| com.squareup.wire:wire-runtime-jvm Maven |
|
|
| com.squareup.wire:wire-runtime Maven |
|
|
Wire provides gRPC and protocol buffers for Android, Kotlin, Swift, and Java. Prior to 6.3.0 and 7.0.0-alpha03, ByteArrayProtoReader32.skipGroup() and ProtoReader.skipGroup() in wire-runtime do not validate that a LENGTH_DELIMITED field length is non-negative before skip(), allowing a crafted protobuf varint encoding -128 as a signed Int to make skip(-128) move the internal position negative and make the next readByte() throw ArrayIndexOutOfBoundsException instead of the documented IOException or ProtocolException, which can crash services using ProtoAdapter.decode(byte[]) on untrusted payloads. This issue is fixed in versions 6.3.0 and 7.0.0-alpha03.
From the CVE record · GitHub_M
The wire-runtime readers do not reject a negative field length while skipping a protobuf group. A crafted payload can trigger an unexpected exception and crash a service that decodes untrusted bytes with ProtoAdapter.decode(byte[]). The input does not specify network access, authentication requirements, or user interaction.
Teams using Maven com.squareup.wire:wire-runtime-jvm or com.squareup.wire:wire-runtime before 6.3.0, or from 7.0.0-alpha01 through versions before 7.0.0-alpha03, should check their dependencies.