Skip to content

Bug in URL validation for the Maltiverse integration #27090

@fdalmaup

Description

@fdalmaup

Description

The maltiverse.py script contains a bug that exposes it to the CVE-2024-11168 vulnerability, expected to be fixed for Python v3.10 in python/cpython#126975. Nevertheless, until the PR is merged and a new patch version is released, we need to modify the script to reduce the risk of unwanted behavior in the script.

def is_valid_url(url: str) -> bool:
"""Check if a URL is valid.
Parameters
----------
url : str
The URL to check.
Returns
-------
bool
True if the URL is valid, False otherwise.
"""
split_url = urlsplit(url)
return bool(split_url.scheme and split_url.netloc)

Tasks

  • Modify the is_valid_url function implementation to check the URL taking into account URL parsing security.
  • Update unit tests if needed.
  • Test the Maltiverse integration and verify it works as expected.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions