or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/atheris@2.3.x
tile.json

tessl/pypi-atheris

tessl install tessl/pypi-atheris@2.3.0

A coverage-guided fuzzer for Python and Python extensions based on libFuzzer

Agent Success

Agent success rate when using this tile

91%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.28x

Baseline

Agent success rate without this tile

71%

task.mdevals/scenario-5/

URL Parser Fuzzing Test

Build a fuzzing test harness for a URL parsing utility. The test should verify that a URL parser correctly handles various malformed inputs without crashing.

Requirements

Create a fuzzing test that:

  1. Implements a URL parser function that extracts protocol, domain, and path from a URL string
  2. Uses function-level instrumentation to ensure the parser is tracked during fuzzing
  3. Converts raw fuzzing bytes into structured string inputs for testing
  4. Executes the fuzzer with a limited number of runs for testing purposes

The URL parser should:

  • Extract the protocol (e.g., "http", "https")
  • Extract the domain name
  • Extract the path (if present)
  • Handle edge cases like missing components, malformed URLs, and special characters
  • Return a dictionary with keys: "protocol", "domain", "path"
  • Raise ValueError for completely invalid URLs (e.g., empty strings)

Test Cases

  • The parser correctly extracts protocol, domain, and path from "https://example.com/page" returning {"protocol": "https", "domain": "example.com", "path": "/page"} @test
  • The parser handles URLs without paths like "http://test.org" returning {"protocol": "http", "domain": "test.org", "path": ""} @test
  • The parser raises ValueError when given an empty string @test
  • The fuzzing harness can execute at least 100 fuzzing iterations without errors @test

Implementation

@generates

API

def parse_url(url: str) -> dict:
    """
    Parse a URL string into its components.

    Args:
        url: The URL string to parse

    Returns:
        Dictionary with keys: protocol, domain, path

    Raises:
        ValueError: If the URL is invalid or empty
    """
    pass

def test_one_input(data: bytes) -> None:
    """
    Fuzzing entry point that receives random bytes.

    Args:
        data: Random bytes from the fuzzer
    """
    pass

Dependencies { .dependencies }

atheris { .dependency }

Provides coverage-guided fuzzing capabilities for Python code.

@satisfied-by