diff options
| author | Dennis Fink | 2026-10-31 19:15:57 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-10-31 19:15:57 +0100 |
| commit | 3d6ee99142fbcc7fabaeab770a9c9e9d090ddf0f (patch) | |
| tree | 52a304df07ef7fcdca1f6a139b94af6c23a15558 /webmentions_ssg/__init__.py | |
| parent | 0afc76fb78518bf8185c02e548e83e63c8bb0153 (diff) | |
| download | webmentions-ssg-3d6ee99142fbcc7fabaeab770a9c9e9d090ddf0f.tar.gz webmentions-ssg-3d6ee99142fbcc7fabaeab770a9c9e9d090ddf0f.zip | |
fix(sender): prevent source scanner path escapes
Reject symlinked source files whose resolved targets leave the
configured source directory so scans cannot read unintended files from
the host filesystem.
Normalize and validate ignored hostname patterns at startup and again at
scan time to keep scanner filtering predictable.
Diffstat (limited to '')
| -rw-r--r-- | webmentions_ssg/__init__.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/webmentions_ssg/__init__.py b/webmentions_ssg/__init__.py index e4a0a30..4c185c7 100644 --- a/webmentions_ssg/__init__.py +++ b/webmentions_ssg/__init__.py @@ -25,6 +25,7 @@ from webmentions_ssg.config import ( DevelopmentConfig, ProductionConfig, normalize_allowed_hostnames, + normalize_ignored_hostnames, ) from .security import validate_secret_key @@ -96,6 +97,9 @@ def create_app(config_class: type[DefaultConfig] | None = None) -> Flask: app.config["ALLOWED_HOSTNAMES"] = normalize_allowed_hostnames( app.config["ALLOWED_HOSTNAMES"] ) + app.config["IGNORED_HOSTNAMES"] = normalize_ignored_hostnames( + app.config["IGNORED_HOSTNAMES"] + ) for key in ( "MAX_CONTENT_LENGTH", "MAX_WEBMENTION_URL_BYTES", |
