Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Uncaught ArrayIndexOutOfBoundsException on Truncated UTF-8 in Jackson Protobuf 2.22.4

Đang mở
#894 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
backend, security

Hướng nghiên cứu

Start with ProtobufParser._finishShortText() and compare its short-string UTF-8 decoding path with the validation work in issue #863 and PR #867. Reproduce using the supplied bytes 72 01 C3 through the public ProtobufMapper API, then check whether the merged fix handles the truncated sequence at the input boundary. Done means confirming the behavior and documenting whether further changes are needed; the issue does not name a test file.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

2.21 protobuf

Summary

Jackson Dataformat Protobuf 2.22.4 throws an uncaught ArrayIndexOutOfBoundsException when decoding a length-delimited Protobuf string containing a truncated multi-byte UTF-8 sequence.

A three-byte input is sufficient to reproduce the exception through the public ProtobufMapper API.

Affected Component

  • Artifact: com.fasterxml.jackson.dataformat:jackson-dataformat-protobuf:2.22.4
  • Method: ProtobufParser._finishShortText()
  • Weakness: Improper array boundary validation leading to an uncaught exception (CWE-129 / CWE-248)

Steps to Reproduce

Using a Protobuf schema containing optional string text = 14, supply the following bytes:

72 01 C3
  • 72: field 14, wire type 2
  • 01: string length of one byte
  • C3: truncated two-byte UTF-8 sequence

The input can be reproduced using ProtobufMapper with the schema and Java proof of concept provided in the technical report.

Actual Result

java.lang.ArrayIndexOutOfBoundsException:
  Index 3 out of bounds for length 3
    at com.fasterxml.jackson.dataformat.protobuf.ProtobufParser._finishShortText(ProtobufParser.java:2379)

The behavior also occurs with the truncated leading bytes DF, E0, and F0.

Root Cause

The short-string UTF-8 decoding path attempts to read continuation bytes without verifying that sufficient bytes remain within the declared string boundary.

The truncated sequence causes the parser to access the input buffer beyond its available length instead of producing a normal parsing exception.

Potential Security Impact

Applications processing untrusted Protobuf messages may experience unexpected rendering or deserialization failures if the unchecked exception escapes the application's error handling.

This may lead to context-dependent denial of service. Service-wide denial of service has not been independently demonstrated.

Related Upstream Work

Issue #863 and PR #867 address invalid UTF-8 decoding and missing continuation-byte validation in ProtobufParser.

This report specifically documents an ArrayIndexOutOfBoundsException when the incomplete UTF-8 sequence reaches the end of the input buffer.

The underlying cause may overlap with the fix in PR #867. The exact proof of concept has not yet been retested against that merged fix.

References:

Request

Could the maintainers confirm whether PR #867 covers this specific exception and whether it warrants separate security tracking or a security advisory?

Ngôn ngữ chính
Java
Star
348
Fork
159
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
45

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của FasterXML/jackson-dataformats-binary

Tất cả issue của FasterXML/jackson-dataformats-binary

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.