Builder emits forbidden XML control characters and validator accepts them
Los mantenedores suelen responder en 4 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 62/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, xml
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
- 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
- Lenguaje dominante
- JavaScript
- Estrellas
- 3.1k
- Forks
- 410
- Merge medio
- 4 d 15 h
- PR fusionados (30 d)
- 8
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de NaturalIntelligence/fast-xml-parser
-
A processing instruction with no target passes validation, then the builder prints invalid XMLPosiblemente ocupada @bardrop la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NaturalIntelligence/fast-xml-parser#927 · 2 comentarios ·
Los mantenedores suelen responder en 4 días
-
XMLValidator accepts double hyphens inside commentsPosiblemente ocupada @Sskift la tomó hace 16 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
NaturalIntelligence/fast-xml-parser#903 · 3 comentarios ·
Los mantenedores suelen responder en 4 días
-
XMLValidator accepts raw < and & in attribute valuesPosiblemente ocupada @jeromeyyy la tomó hace 14 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
NaturalIntelligence/fast-xml-parser#900 · 3 comentarios ·
Los mantenedores suelen responder en 4 días
-
getMetaDataSymbol() declares a boxed SymbolPosiblemente ocupada @chiragbitoni la tomó hace 4 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
NaturalIntelligence/fast-xml-parser#890 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
NaturalIntelligence/fast-xml-parser#888 · 2 comentarios ·
Los mantenedores suelen responder en 4 días
Todos los issues de NaturalIntelligence/fast-xml-parser
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
-
Extended search drops any query term that contains a line breakPosiblemente ocupada @goranai la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
0.3.14: pdfmake.virtualfs renamed to sharedVirtualfs without changelog entry (breaking change)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día