Avro: invalid UTF-8 sequences (overlong, surrogates, > U+10FFFF, bad continuation bytes) not rejected in strings
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 57/100
Hướng nghiên cứu
Start with JacksonAvroParserImpl and trace the short-text loop, _finishLongText(), _decodeUTF8_3(), and _decodeUTF8_4(). Compare the short and long paths using the listed malformed byte sequences in string values and map keys; fix the broken invalid-lead-byte format string as well. Done when invalid UTF-8 is rejected consistently across both paths and the error reports the byte correctly.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The Avro parser (JacksonAvroParserImpl) accepts several invalid UTF-8 sequences in string values and map keys and decodes them into characters. RFC 3629 makes these sequences invalid.
Same class of bug as FasterXML/jackson-core#1782 and FasterXML/jackson-dataformats-text#763.
Reproduced on 2.x:
AvroMapper mapper = new AvroMapper();
AvroSchema schema = mapper.schemaFrom(
"{\"type\":\"record\",\"name\":\"R\",\"fields\":[{\"name\":\"s\",\"type\":\"string\"}]}");
// zigzag length 4, then 'a' C0 AF 'b'
byte[] doc = {0x08, 'a', (byte) 0xC0, (byte) 0xAF, 'b'};
JsonParser p = mapper.getFactory().createParser(doc);
p.setSchema(schema);
p.nextToken(); p.nextToken(); p.nextToken();
p.getText(); // -> "a/b"
| Bytes | Result |
|---|---|
C0 AF, E0 80 AF (overlong) |
/ |
F0 80 80 AF (overlong 4-byte) |
\uDC2F |
ED A0 80 (encoded surrogate) |
lone \uD800 |
F4 90 80 80 (above U+10FFFF) |
\uDC00\uDC00 |
F5 80 80 80 (lead byte F5-F7) |
\uDCC0\uDC00 |
C3 41, E2 41 41, F0 41 41 41 (missing continuation bytes) |
Á, ⁁, ᅣ\uDC41 |
The missing-continuation rows apply to strings that fit in the input buffer (the short-text loop). _finishLongText() rejects them. The other rows apply to both paths and to map keys.
Separately, the error for an invalid lead byte in the short-text path has a broken format string:
Invalid byte 0x2X in Unicode text block
String.format("Invalid byte 0x2X in Unicode text block", i) should be "... 0x%02X ...".
Suggested fix: check continuation bytes in the short-text loop. After decoding, check minimum values of 0x80, 0x800 and 0x10000 for 2-, 3- and 4-byte sequences, a maximum of 0x10FFFF, and reject 0xD800-0xDFFF, in both the short-text loop and _decodeUTF8_3()/_decodeUTF8_4().
- Ngôn ngữ chính
- Java
- Star
- 348
- Fork
- 159
- Merge trung bình
- 22 giờ 34 phút
- Pull request đã merge (30 ngày)
- 39
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
-
smile
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 71/100
FasterXML/jackson-dataformats-binary#869 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
cbor
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
FasterXML/jackson-dataformats-binary#868 ·
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 56/100
FasterXML/jackson-dataformats-binary#863 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
smile
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
FasterXML/jackson-dataformats-binary#861 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
cbor
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
FasterXML/jackson-dataformats-binary#860 ·
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ự
-
Shaded google-api-client trust stores still include AAA Certificate Services (eMudhra CA compromise)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
snowflakedb/snowflake-jdbc#2763 ·
-
MacFileUtils: FSPathMakeRef passes an int where the C function takes its FSRef output pointerĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 79/100
java-native-access/jna#1746 ·
-
Pooled clients leak a connection per call: pipelines and transactions taken from UnifiedJedis are never closedCó thể đã có người làm @ali-jawad đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
-
[BUG] spark: Iceberg REST catalog symlinks collide when multiple catalogs share one REST URIĐang mởkind:bug state:needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
OpenLineage/OpenLineage#5100 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
adorsys/keycloak-config-cli#1709 ·
Maintainer thường phản hồi trong vòng 1 ngày