Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. safeurl-python
  4. ›
  5. GMS-2023-177

GMS-2023-177: Permissive regex leads to domain filter bypass

January 27, 2023

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 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)

References

  • github.com/IncludeSecurity/safeurl-python/pull/5/commits/42dd0c8e5fc84e17e1d3578d18aaea169eece474
  • github.com/IncludeSecurity/safeurl-python/security/advisories/GHSA-jgh8-vchw-q3g7
  • github.com/advisories/GHSA-jgh8-vchw-q3g7

Code Behaviors & Features

Detect and mitigate GMS-2023-177 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.2

Fixed versions

  • 1.2

Solution

Upgrade to version 1.2 or above.

Source file

pypi/safeurl-python/GMS-2023-177.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:59 +0000.