Builder emits forbidden XML control characters and validator accepts them
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 62/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, xml
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
- 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
- 主要语言
- JavaScript
- 星标
- 3.1k
- 派生
- 410
- 平均合并
- 4 天 15 小时
- 30 天内合并 PR
- 8
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NaturalIntelligence/fast-xml-parser 的其他 Issue
-
A processing instruction with no target passes validation, then the builder prints invalid XML可能已有人在做 @bardrop 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
NaturalIntelligence/fast-xml-parser#927 · 2 条评论 ·
维护者通常 4 天内回复
-
XMLValidator accepts double hyphens inside comments可能已有人在做 @Sskift 于 16 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
NaturalIntelligence/fast-xml-parser#903 · 3 条评论 ·
维护者通常 4 天内回复
-
XMLValidator accepts raw < and & in attribute values可能已有人在做 @jeromeyyy 于 14 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
NaturalIntelligence/fast-xml-parser#900 · 3 条评论 ·
维护者通常 4 天内回复
-
getMetaDataSymbol() declares a boxed Symbol可能已有人在做 @chiragbitoni 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
NaturalIntelligence/fast-xml-parser#890 · 1 条评论 ·
维护者通常 4 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
NaturalIntelligence/fast-xml-parser#888 · 2 条评论 ·
维护者通常 4 天内回复
查看 NaturalIntelligence/fast-xml-parser 的全部 Issue
相似的 Issue
-
bug
难度 1/5 1-3 小时 新手友好度 86/100
jellyfin/jellyfin-web#8865 ·
维护者通常 1 天内回复
-
area:contract P3
难度 1/5 1 小时以内 新手友好度 85/100
grafana/viz-contract#100 ·
维护者通常 1 天内回复
-
SUB-1: [CI] Update deprecated CodeQL Action v2 to v4可能已有人在做 @AnkitSatpute 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 93/100
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 84/100