2.0.0-rc.15: <Errored> writes a string child as raw HTML on the server
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, typescript
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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 <script>alert(1)</script>
Loading <script>alert(1)</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.
- Lingua principale
- TypeScript
- Stelle
- 36.1k
- Fork
- 1.1k
- Merge medio
- 11h 49m
- PR unite (30g)
- 346
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 solidjs/solid
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 18/100
I maintainer di solito rispondono entro 1 giorno
-
[2.0 / next] Error formatting and async iterator protocol failures escape memo error handlingAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 14/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di solidjs/solid
Issue simili
-
bug engine
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
frostney/GocciaScript#1746 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
agilepathway/label-checker#739 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
CopilotKit/OpenBot#800 ·
I maintainer di solito rispondono entro 1 giorno
-
Endpoint links in the tag operations list are below the 24px target sizeForse già presa @AdzerKI l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
ehmpathy/rhachet-roles-bhuild#471 ·
I maintainer di solito rispondono entro 1 giorno