Skip to content

Source spec parser breaks on Windows drive letter paths #24

Description

@oritwoen

The source specification parser in source/mod.rs uses split_once(':') to detect provider prefixes:

if let Some((provider, path)) = spec.split_once(':') {
    match provider {
        "seclists" => ...,
        "aspell" => ...,
        "file" => ...,
        _ => bail!("Unknown source provider: '{}'", provider),
    }
}

On Windows, a bare path like C:\wordlists\rockyou.txt would be split into provider C and path \wordlists\rockyou.txt, producing the error "Unknown source provider: 'C'".

The file:path prefix exists as a workaround, but a bare path (which is the most common usage via shaha build C:\words.txt) goes through the positional input arg and then to_string_lossy(), hitting this parser.

A simple fix would be to check if the provider portion is a single ASCII letter before treating it as a provider name, since all actual providers (seclists, aspell, file) are longer than one character.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions