Decide: restore html-comment-strip broad sweep with framework-marker allowlist
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 30/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
- 技术栈
- typescript
- 领域
- security
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- TypeScript
- 星标
- 35
- 派生
- 4
- 平均合并
- 4 天 14 小时
- 30 天内合并 PR
- 36
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pixiebrix/agent-browser-shield 的其他 Issue
-
enhancement rule-proposal
难度 5/5 一周以上 新手友好度 28/100
pixiebrix/agent-browser-shield#123 · 1 条评论 ·
-
enhancement rule-proposal
难度 5/5 一周以上 新手友好度 25/100
-
enhancement rule-proposal
难度 5/5 一周以上 新手友好度 38/100
pixiebrix/agent-browser-shield#121 · 1 条评论 ·
-
enhancement rule-proposal
难度 5/5 一周以上 新手友好度 35/100
查看 pixiebrix/agent-browser-shield 的全部 Issue
相似的 Issue
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 1/5 1 小时以内 新手友好度 85/100
-
Mend: dependency security vulnerability untriaged
难度 2/5 1-3 小时 新手友好度 70/100