Decide: restore html-comment-strip broad sweep with framework-marker allowlist
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Tranquilo
- Stack tecnológico
- typescript
- Área
- security
Línea de trabajo
Start by reading issue #176 and the current html-comment-strip behavior, including the INJECTION_PATTERNS set and its blanking semantics. Catalog the framework marker shapes and SSR or license comments named in this issue, then document whether a stable allowlist supports restoring the broad sweep. Done means a clear decision about the behavior and the risks of keeping the allowlist synchronized.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Follow-up to #176.
Before #176, html-comment-strip removed every comment outside <script> / <style> / <noscript>. After #176, it scrubs only comments whose data matches the INJECTION_PATTERNS set (currently 11 patterns) — and blanks them in place rather than detaching. The narrowing is what makes React Suspense markers ($, /$, $?, $!, [, ], …) safe automatically: they don't match any pattern, so they're left alone, and the framework's unmount walk doesn't trip on a missing node.
Tradeoff
Narrowing to pattern matches caps coverage at the recognized shapes. Novel injection phrasings, off-pattern prose, and benign-looking comments carrying instruction-shaped text — all of which used to be removed — now stay visible.
Decision needed
Should we restore broad-sweep behavior with a framework-marker allowlist (skip $ / /$ / [ / ]-prefixed data, plus any other markers we identify), and continue blanking via comment.data = \"\" rather than detaching?
Tradeoffs to weigh:
- For: restores pre-#176 coverage for off-pattern injection prose; reduces dependence on
INJECTION_PATTERNSkeeping pace with attacker phrasing. - Against: allowlist enumeration becomes load-bearing — a missed framework marker re-introduces the navigation crash class through a different path. Frameworks evolve their hydration marker syntax over time (React 18 → 19 changed marker shapes); we'd need a story for keeping the allowlist in sync.
Either way, no detach — the carrier stays attached.
Suggested next step
Catalog the marker shapes currently in the wild (React 18/19, Vue 3, Svelte 4/5, Astro islands, htmx, Lit hydration) and a few SSR build stamps / license headers we don't want to touch, then re-evaluate whether the allowlist is small/stable enough to be worth the broad sweep.
- Lenguaje dominante
- TypeScript
- Estrellas
- 35
- Forks
- 4
- Merge medio
- 4 d 14 h
- PR fusionados (30 d)
- 36
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 pixiebrix/agent-browser-shield
-
Rule proposal: canvas-text-annotate — flag canvas/video text surfaces invisible to DOM walkers Abiertoenhancement rule-proposal
Dificultad 5/5 Más de una semana Aptitud para principiantes 28/100
pixiebrix/agent-browser-shield#123 · 1 comentario ·
-
enhancement rule-proposal
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
-
enhancement rule-proposal
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
pixiebrix/agent-browser-shield#121 · 1 comentario ·
-
enhancement rule-proposal
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Todos los issues de pixiebrix/agent-browser-shield
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
receptron/mulmoterminal#2264 ·
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
components-web-app/docs#96 ·
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
simonsobs/tileviewer#114 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100