Builder emits forbidden XML control characters and validator accepts them
I maintainer di solito rispondono entro 4 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 62/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, xml
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
- 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
- Lingua principale
- JavaScript
- Stelle
- 3.1k
- Fork
- 410
- Merge medio
- 4g 15h
- PR unite (30g)
- 8
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NaturalIntelligence/fast-xml-parser
-
A processing instruction with no target passes validation, then the builder prints invalid XMLForse già presa @bardrop l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NaturalIntelligence/fast-xml-parser#927 · 2 commenti ·
I maintainer di solito rispondono entro 4 giorni
-
XMLValidator accepts double hyphens inside commentsForse già presa @Sskift l’ha presa 16 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
NaturalIntelligence/fast-xml-parser#903 · 3 commenti ·
I maintainer di solito rispondono entro 4 giorni
-
XMLValidator accepts raw < and & in attribute valuesForse già presa @jeromeyyy l’ha presa 14 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
NaturalIntelligence/fast-xml-parser#900 · 3 commenti ·
I maintainer di solito rispondono entro 4 giorni
-
getMetaDataSymbol() declares a boxed SymbolForse già presa @chiragbitoni l’ha presa 4 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
NaturalIntelligence/fast-xml-parser#890 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
NaturalIntelligence/fast-xml-parser#888 · 2 commenti ·
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di NaturalIntelligence/fast-xml-parser
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
-
Extended search drops any query term that contains a line breakForse già presa @goranai l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
0.3.14: pdfmake.virtualfs renamed to sharedVirtualfs without changelog entry (breaking change)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno