From f7c0691e0da84644ea8b2b83ad5574fe179da59b Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Sat, 31 Oct 2026 17:49:44 +0100 Subject: fix(core): reject IPv6 transition addresses Harden public-address validation against NAT64, IPv4-compatible, 6to4, and IPv4-mapped IPv6 forms that can encapsulate private or metadata destinations. Apply the same check to literal form validation and DNS-resolved addresses so SSRF protections do not rely on Python's `is_global` behavior alone. --- webmentions_ssg/forms/validators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'webmentions_ssg/forms') diff --git a/webmentions_ssg/forms/validators.py b/webmentions_ssg/forms/validators.py index 36f36ce..c1f1c97 100644 --- a/webmentions_ssg/forms/validators.py +++ b/webmentions_ssg/forms/validators.py @@ -11,7 +11,7 @@ from flask import current_app from wtforms import Field, ValidationError from wtforms.form import BaseForm -from ..url_security import AddressResolutionError, is_public_url +from ..url_security import AddressResolutionError, is_public_address, is_public_url class URLMaxBytes: @@ -174,5 +174,5 @@ class PublicIPLiteral: except ValueError: return # Named hosts are resolved only during the background fetch. - if not address.is_global: + if not is_public_address(address): raise ValidationError(field.gettext("URL must use a public address.")) -- cgit v1.3.1