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 package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| safeurl-python (PyPI) | before 1.2 | GitHub Advisory Database, PyPA Advisory Database |
| includesecurity safeurl-python | 1.0 | NVD |
All scores
| CISA-ADP | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| GitHub | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N |
| NVD | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| PyPA Advisory Database | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
Classification
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
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
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2023-24622 changed 2025-03-28 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-jgh8-vchw-q3g7 changed 2026-05-04 | CC-BY-4.0 |
| NVD | CVE-2023-24622 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2023-298 changed 2026-07-02 | CC-BY-4.0 |