Builder emits forbidden XML control characters and validator accepts them
Maintainer thường phản hồi trong vòng 4 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
- 62/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, xml
Hướng nghiên cứu
Start with the XML builder and validator entry points in the fast-xml-parser source, where text values are escaped before output; the repro in the issue calls XMLBuilder().build and XMLValidator.validate on { a: "\u0000" }. Check whether the builder's text handling and the validator's character checks cover the XML 1.0 forbidden range U+0000-U+0008, U+000B, U+000C, U+000E-U+001F. Done when the builder no longer emits these code points and XMLValidator.validate rejects text containing them, with tests for U+0000 and U+0001.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
- Are you running the latest version? (
5.11.2,masteratcf66a9658004553bc740616e6c7a4912e7e9aab6) - Have you included sample input, output, error, and expected output?
- Have you checked if you are using correct configuration? (default builder, validator, and parser options)
- Did you try the online tool? (it reports
Valid XMLfor the standalone NUL sample) - Have you checked the docs for helpful APIs and examples?
Description
The builder emits U+0000 and U+0001 verbatim, and the validator accepts the resulting text as valid XML. XML 1.0 Character Range excludes both code points. This can produce documents that a conforming XML reader cannot consume.
Input
{ a: "\u0000" } (the JavaScript string contains an actual NUL after escape processing). U+0001 behaves the same. U+0009 and U+000A are valid controls.
Code
const { XMLBuilder, XMLValidator, XMLParser } = require("./lib/fxp.cjs");
const xml = new XMLBuilder().build({ a: "\u0000" });
console.log(JSON.stringify(xml));
console.log(XMLValidator.validate(xml));
console.log(JSON.stringify(new XMLParser().parse(xml, true)));
Output
"<a>\u0000</a>"
true
{"a":"\u0000"}
Expected data
The builder should avoid emitting forbidden XML characters, and the validator should reject XML text containing U+0000 or U+0001.
Would you like to work on this issue?
- Yes
- No
- Ngôn ngữ chính
- JavaScript
- Star
- 3.1k
- Fork
- 410
- Merge trung bình
- 4 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 8
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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 NaturalIntelligence/fast-xml-parser
-
A processing instruction with no target passes validation, then the builder prints invalid XMLCó thể đã có người làm @bardrop đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NaturalIntelligence/fast-xml-parser#927 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
XMLValidator accepts double hyphens inside commentsCó thể đã có người làm @Sskift đã nhận 16 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
NaturalIntelligence/fast-xml-parser#903 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
XMLValidator accepts raw < and & in attribute valuesCó thể đã có người làm @jeromeyyy đã nhận 14 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
NaturalIntelligence/fast-xml-parser#900 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
getMetaDataSymbol() declares a boxed SymbolCó thể đã có người làm @chiragbitoni đã nhận 4 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
NaturalIntelligence/fast-xml-parser#890 · 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 65/100
NaturalIntelligence/fast-xml-parser#888 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của NaturalIntelligence/fast-xml-parser
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
-
Extended search drops any query term that contains a line breakCó thể đã có người làm @goranai đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
0.3.14: pdfmake.virtualfs renamed to sharedVirtualfs without changelog entry (breaking change)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày