Uncaught ArrayIndexOutOfBoundsException on Truncated UTF-8 in Jackson Protobuf 2.22.4
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
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ả
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 201: string length of one byteC3: 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:
- https://github.com/FasterXML/jackson-dataformats-binary/issues/863
- https://github.com/FasterXML/jackson-dataformats-binary/pull/867
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của FasterXML/jackson-dataformats-binary
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
FasterXML/jackson-dataformats-binary#790 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
FasterXML/jackson-dataformats-binary#789 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
FasterXML/jackson-dataformats-binary#788 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
FasterXML/jackson-dataformats-binary#766 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
protobuf
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
FasterXML/jackson-dataformats-binary#630 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của FasterXML/jackson-dataformats-binary
Issue tương tự
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
authorjapps/zerocode#808 ·
-
upgrade to checkstyle 14.4.0Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
checkstyle/sonar-checkstyle#625 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
quarkusio/quarkus-agent-mcp#302 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
build
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
MetricsHub/metricshub-community#1472 ·
Maintainer thường phản hồi trong vòng 1 ngày