Malformed telemetry can crash the server

未关闭 适合新手
#51 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
62/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
backend, security

调研方向

panic 来自 src/results/telemetry.rs 第 202 行附近对 data.isp_info 执行 serde_json::from_str 后的 unwrap(),不可信的遥测值在这里被解析为 IPInfo。请先阅读该函数和 IPInfo 结构体,然后发送一个带有 ispinfo={} 的遥测请求并打开返回的结果 ID 来复现问题。当格式错误的 ispinfo 产生回退结果或被拒绝的请求而不是 panic,并且有测试覆盖该错误情况时,即为完成。

由索引模型根据 Issue 内容生成。

描述

When telemetry is enabled, a malformed ispinfo value can crash the server when a shared result is opened.

Steps to reproduce:

  1. Send a telemetry request with ispinfo={}.
  2. Use the returned result ID to open /backend/results/?id=<id>.
  3. The server panics with missing field processedString and exits.

Expected behavior:

Malformed telemetry should not crash the server. The result should use a safe fallback, or the telemetry request should be rejected.

Cause:

src/results/telemetry.rs line 202 parses untrusted telemetry with:

let isp_info: IPInfo = serde_json::from_str(&data.isp_info).unwrap();

Because this runs from a public endpoint, an unauthenticated user can repeatedly terminate the process.

Suggested fix:

Handle invalid ispinfo instead of using unwrap(). Fall back to the client IP or "Unknown connection". Validating ispinfo before storing it would also help.

主要语言
Rust
星标
254
派生
40
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

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

librespeed/speedtest-rust 的其他 Issue

查看 librespeed/speedtest-rust 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

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