Advisories for Pypi/Safeurl-Python package

2023

SafeURL-Python's hostname blocklist does not block FQDNs

Description If a hostname was block listed, it was possible to bypass the block list by requesting the FQDN of the host (e.g. adding . to the end). Impact The main purpose of this library is to block requests to internal/private IPs and these cannot be bypassed using this finding. But if a library user had specifically set certain hostnames as blocked, then an attacker would be able to circumvent …

Permissive regex leads to domain filter bypass

Description In SafeURL it is possible to specify a list of domains that should be matched before a request is sent out. The regex used to compare domains does not work as intended. Impact The regex used was: re.match("(?i)^%s" % domain, value) This has two problems, first that only the beginning and not the end of the string is anchored. Second, that a dot in the domain matches any character …