CVE-2023-24622
JSON

5.3medium

safeurl-python contains Server-Side Request Forgery

Severity
5.3medium CVSS:3.1 by CISA-ADP
Exploit likelihood
0.58% (higher than 42% of CVEs)
Published
Last changed
Assigned by
mitre
Also known as
GHSA-jgh8-vchw-q3g7PYSEC-2023-298

Description

isInList in the safeurl-python package before 1.2 for Python has an insufficiently restrictive regular expression for external domains, leading to SSRF.

Affected

Product or packageVersionsReported by
Unspecified productn/aCVE List
safeurl-python (PyPI)before 1.2GitHub Advisory Database, PyPA Advisory Database
includesecurity safeurl-python1.0NVD

All scores

CISA-ADP5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
GitHub5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
PyPA Advisory Database5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Classification

CWE-918

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.

What each source says

CVE List

isInList in the safeurl-python package before 1.2 for Python has an insufficiently restrictive regular expression for external domains, leading to SSRF.

GitHub Advisory Database
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 did 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 as part of regex syntax.

Therefore, an allowlist of ["victim.com"] could allow the domain "victimacomattacker.com" to be requested.

This has lower impact since the usual attacker aim in an SSRF is to request internal resources such as private IP addresses rather than an attacker's own domain. But, in a case where SafeURL had specifically been used to try to limit requests to a particular allowlist, say for example a PDF renderer, the finding would be more severe.

Patches

Fixed in https://github.com/IncludeSecurity/safeurl-python/pull/5

References

Server-side request forgery (SSRF)

NVD (es)

isInList en el paquete safeurl-python anterior a 1.2 para Python tiene una expresión regular insuficientemente restrictiva para dominios externos, lo que lleva a SSRF.

References

Sources

SourceRecordLicence
CVE ListCVE-2023-24622 changed 2025-03-28CVE Terms of Use
GitHub Advisory DatabaseGHSA-jgh8-vchw-q3g7 changed 2026-05-04CC-BY-4.0
NVDCVE-2023-24622 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2023-298 changed 2026-07-02CC-BY-4.0