Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[interpreter] Text lexer accepts surrogate escapes and crashes on escapes past U+10FFFF

已关闭 适合新手
#2,287 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 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 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

WebAssembly/spec 的其他 Issue

查看 WebAssembly/spec 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。