Skip to content

Normalize punycode labels in extraction results#369

Open
gaoflow wants to merge 1 commit into
john-kurkowski:masterfrom
gaoflow:fix-idna-suffix-normalization
Open

Normalize punycode labels in extraction results#369
gaoflow wants to merge 1 commit into
john-kurkowski:masterfrom
gaoflow:fix-idna-suffix-normalization

Conversation

@gaoflow

@gaoflow gaoflow commented Jun 19, 2026

Copy link
Copy Markdown

Summary:

  • Decode valid xn-- labels before assembling extraction result fields so Unicode and ACE forms produce the same suffix/fqdn.
  • Preserve invalid punycode labels unchanged.
  • Add regression coverage for equivalent Unicode and punycode IDN suffixes.

Tests:

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .tox/py310/bin/python -m pytest tests/main_test.py -k puny -q
  • .tox/py310/bin/ruff format .
  • uv run tox -e py310 -- -p no:gitignore
  • uv run tox -e lint
  • uv run tox -e typecheck
  • uv run tox -e codestyle

Note: the local fresh tox environment installs pytest 9.1.1 and pytest-gitignore currently fails during plugin loading, so the py310 run disables only that plugin with -p no:gitignore.

Fixes #366

AI assistance was used under my direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Punycode/Unicode form returns different suffix/fqdn for the same DNS domain — enables blocklist/allowlist bypass

1 participant