[interpreter] Text lexer accepts surrogate escapes and crashes on escapes past U+10FFFF
维护者通常 1 天内回复
已经有一个关联 PR 被合并了。
- #2295 来自 @rossberg —— 已合并
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 66/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 领域
- backend
调研方向
从文本字符串词法分析器的 u 转义处理开始,检查它如何调用 Utf8.encode;issue 没有指定文件或测试路径。检查所提供的示例中代理值和超出范围的值,然后运行相关的解释器测试。完成的标准是两种输入都会报告字符串格式错误,而不是生成无效的 UTF-8 或抛出未捕获的异常。
由索引模型根据 Issue 内容生成。
描述
\u{n} is well-formed only for n < 0xD800 or 0xE000 <= n < 0x110000.
Surrogates are accepted and encoded as invalid UTF-8:
(module (memory 1) (data (i32.const 0) "\u{D800}"))
This parses, and the data segment holds ED A0 80. It should be malformed.
Escapes past U+10FFFF crash the interpreter instead of reporting a syntax error:
(assert_malformed (module quote "(data \"\\u{110000}\")") "malformed UTF-8")
uncaught exception Wasm.Utf8.Utf8
The u case of the string lexer calls Utf8.encode with no check and no handler. encode doesn't reject surrogates and raises Utf8 for n >= 0x110000.
Tested at 340650f.
- 主要语言
- WebAssembly
- 星标
- 3.5k
- 派生
- 540
- 平均合并
- 23 小时 36 分钟
- 30 天内合并 PR
- 26
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
WebAssembly/spec 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 66/100
WebAssembly/spec#2302 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 53/100
WebAssembly/spec#2301 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 25/100
WebAssembly/spec#2279 · 6 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
WebAssembly/spec#2258 · 4 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
[js-api] A mutable global import allocates a const global before LinkError可能已有人在做 @chicoxyzzy 于 18 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 58/100
WebAssembly/spec#2253 ·
维护者通常 1 天内回复
相似的 Issue
-
needs-triage
难度 2/5 1-3 小时 新手友好度 78/100
11ty/buildawesome#4407 · 1 个 reaction ·
维护者通常 1 天内回复
-
area: image-engine bug priority: low
难度 2/5 1-3 小时 新手友好度 88/100
snapotter-hq/SnapOtter#3885 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
keyxmakerx/Chronicle#1721 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
Gentleman-Programming/gentle-ai#5720 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复