Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

2.0.0-rc.15: <Errored> writes a string child as raw HTML on the server

Cerrado
#4,116 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
Medio día
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript, typescript

Línea de trabajo

Start with the repro in the issue: call renderToString on a string child under Loading and under Errored, and compare the output. Find where the server path for Errored emits its children without the escaping that Loading applies. Done when Errored escapes string, array and function children the same way Loading does, and the escape() workaround is no longer needed.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

On the server, a string child of <Errored> is written into the HTML unescaped. The same string is escaped as a plain child and as a child of <Loading>, so user text returned from a component inside an error boundary becomes live markup (stored XSS), and the client, which renders a text node, mismatches on hydrate.

Versions: solid-js and @solidjs/web 2.0.0-rc.15 (also rc.14), renderToString on Node.

import { createComponent, Errored, Loading } from "solid-js"
import { renderToString } from "@solidjs/web"

const evil = "<script>alert(1)</script>"
const show = (name: string, fn: () => unknown) => console.log(name.padEnd(12), renderToString(fn as never))
show("plain", () => evil)
show("Loading", () => createComponent(Loading, { fallback: "", get children() { return evil } }))
show("Errored", () => createComponent(Errored, { fallback: "", get children() { return evil } }))
plain        &lt;script>alert(1)&lt;/script>
Loading      &lt;script>alert(1)&lt;/script>
Errored      <script>alert(1)</script>

An array of strings, or a function returning a string, as the boundary's child is raw too.

Expected: Errored escapes its children as Loading does. Workaround: pass the boundary's children through escape() from @solidjs/web on the server.

Lenguaje dominante
TypeScript
Estrellas
36.1k
Forks
1.1k
Merge medio
11 h 42 min
PR fusionados (30 d)
350

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de solidjs/solid

Todos los issues de solidjs/solid

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.