Skip to content

No HTTPS enforcement on repository URLs #7

Description

@lcarva

Description

In verify.py:29, repository URLs resolved from PyPI metadata or deps.dev are not validated to use HTTPS. An http:// URL would be cloned without TLS, making the clone vulnerable to man-in-the-middle attacks.

The pypi.py regex (_VCS_HOST_RE) matches both http:// and https:// URLs without distinction:

_VCS_HOST_RE = re.compile(
    r"https?://(?:github\.com|gitlab\.com|bitbucket\.org)/[^/]+/[^/]+"
)

Suggested fix

Either:

  • Reject non-HTTPS repository URLs at verification time
  • Automatically upgrade http:// to https:// for known VCS hosts
  • At minimum, warn the user when cloning over plain HTTP

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions