servo / servo/rust-url

Slicing error found by afl.rs

Open
#654 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.6k
Forks
406
PR merge metrics
No merged PRs in 30d

Description

I've used afl.rs to heavily test url2.2.0, and some slicing error may occured when specific input is provided.
To replay the panic, the test code is

let mut _local1 = url::Url::parse("arhttpsps:/.//eom/dae.com/\\\\t\\:").unwrap();
let _ = url::quirks::set_hostname(&mut _local1 ,"//eom/datcom/\\\\t\\://eom/data.cs");

I also placed the replay file at https://github.com/StevenJiang1110/afl_rust_crashes/tree/main/url/replay_url40
I hope you will check if this is an actually bug. Thanks a lot.
The simple bug report is like this.
截屏2020-12-02 下午4 24 57

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

The report provides a Rust reproducer using url::Url::parse and url::quirks::set_hostname, plus a linked replay file. Start by running the reproducer against current rust-url and inspect the replay input; trace the URL parsing and hostname-handling path to determine whether the reported slicing panic still occurs. Done means the behavior is confirmed and its handling is covered by an appropriate regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.