Skip to content

No fuzz targets; Wayback parser edge cases (1 MiB line) untested #259

Closed

Description

@TMHSDigital

Summary

The repository has no fuzz targets (grep "^func Fuzz" finds none), and the Wayback parser's edge cases are untested. One of them looks like a latent bug: a single CDX line over 1 MiB fails the whole source.

Where

  • internal/passive/wayback.go:82, :95, :104-106, :117-119: the scanner buffer cap (1 MiB per line), URL parse errors, transport errors, and the silent 64 MiB truncation

Test cases to add

  • A body with one 2 MiB line followed by http://www.example.com/. Decide on the behaviour (skipping the oversized line is better than dropping every name) and assert it.
  • Hosts with userinfo (http://[email protected]), IPv6 literals, *.example.com, and an uppercase domain argument.
  • Transport error and malformed URL lines.
  • Fuzz targets: hostNames (wayback), labzone.Parse, validate.NormalizeDomain, wordlist.Normalize, MCP dispatch (one JSON-RPC line), and readTransferMessage (see the AXFR issue).

Getting started

  • Relevant files: internal/passive/wayback.go, internal/labzone, internal/validate, internal/wordlist, internal/mcp
  • How to run tests: go test ./internal/passive/; fuzz with go test -fuzz=FuzzX -fuzztime=30s ./internal/<pkg>/
  • Related docs: docs/DEVELOPER_GUIDE.md

Filed by repo-audit/full-audit at 3f671b2. Severity: low. Effort: M. audit-key: testing|internal/passive/wayback.go|fuzz

Activity

  1. added
    help wanted
    testing
    severity: low
    on Nov 14, 2026
  2. TMHSDigital commented on Nov 14, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in 3a68ccb: Wayback lines over 1 MiB are now skipped instead of failing the answer (tested with a 2 MiB line), with tests for userinfo, IPv6 literals, wildcards, malformed URLs, uppercase domain, missing final newline and a dropped connection. New fuzz targets: FuzzHostNames, labzone FuzzParse, FuzzNormalizeDomain, wordlist FuzzNormalize, mcp FuzzDispatch (AXFR/denial already had FuzzReadTransferMessage/FuzzReadDenial). Each was fuzzed 15-20s locally; FuzzNormalizeDomain found a real bug, filed as #281. Full test suite and golangci-lint v2.15.0 pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedseverity: lowtesting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions