Malformed telemetry can crash the server

Open Beginner friendly
#51 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
backend, security

Research direction

The panic comes from an unwrap() on serde_json::from_str of data.isp_info at about line 202 of src/results/telemetry.rs, where the untrusted telemetry value is parsed into IPInfo. Start by reading that function and the IPInfo struct, then reproduce by sending a telemetry request with ispinfo={} and opening the returned result ID. Done when malformed ispinfo produces a fallback or a rejected request instead of a panic, and a test covers the malformed case.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Rust
Stars
254
Forks
40
PR merge metrics
No merged PRs in 30d

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from librespeed/speedtest-rust

All issues in librespeed/speedtest-rust

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.