Skip to content

bundler catalog validator leaks raw ValueError on a malformed URL #3432

Description

@Quratulain-bilal

description

_validate_remote_url in src/specify_cli/bundler/services/adapters.py reads parsed.hostname on the user-supplied catalog url. urlparse/hostname raise ValueError on a malformed authority (e.g. an unclosed ipv6 bracket https://[::1), so instead of the clean BundlerError every other reject path in that function produces, a raw ValueError: Invalid IPv6 URL escapes and crashes the catalog fetch.

this is the bundler sibling of #3369, which fixed the cli extension/preset/workflow add entry points but not this validator (nor the bundle catalog add path that reaches it via #3367).

repro:

from specify_cli.bundler.services import adapters
adapters._validate_remote_url("team", "https://[::1")  # ValueError: Invalid IPv6 URL

expected: a BundlerError like the host-less and non-https cases already raise.

note: i used an ai assistant to help investigate and write this up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions