Executive brief
Square Wire, a library used for handling gRPC and protocol buffers in mobile and Java applications, contains a flaw in how it processes certain data messages. An attacker can send a specially crafted message that causes the application to crash unexpectedly. This can lead to a denial-of-service (DoS) condition, disrupting services that rely on this library to process external data.
Technical details
A vulnerability exists in the ByteArrayProtoReader32.skipGroup() and ProtoReader.skipGroup() functions within the wire-runtime component. The root cause is a failure to validate that a LENGTH_DELIMITED field length is non-negative before calling the skip() method. An attacker can provide a crafted protobuf varint encoding -128 as a signed integer, which causes the internal reader position to become negative. Subsequent read operations then trigger an unhandled ArrayIndexOutOfBoundsException instead of the expected IOException or ProtocolException. This results in a service crash when decoding untrusted payloads via ProtoAdapter.decode(byte[]). The issue is resolved in versions 6.3.0 and 7.0.0-alpha03.
Affected products
- Square wire-runtime < 6.3.0, >= 7.0.0-alpha01, < 7.0.0-alpha03
Timeline
- 2026-05-12: patched: Fix merged into master branch
- 2026-05-13: patched: Fix merged into 6.x branch and version 6.3.0 released
- 2026-05-14: advisory: GitHub Security Advisory published
- 2026-07-17: disclosed: CVE published to NVD
References
- https://github.com/square/wire/commit/47d5b0dba53935d5332cd41a80a353b3fc90e7b0
- https://github.com/square/wire/commit/e4e56fab38a547d9625f05c97f1d8f0bcc3a5773
- https://github.com/square/wire/pull/3595
- https://github.com/square/wire/pull/3597
- https://github.com/square/wire/releases/tag/6.3.0
- https://github.com/square/wire/releases/tag/7.0.0-alpha03
- https://github.com/square/wire/security/advisories/GHSA-7xpr-hc2w-34m9