aboutsummaryrefslogtreecommitdiffstats
path: root/tests/fixtures/simple.eml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-09 09:42:11 +0200
committerDanilo M. <danix@danix.xyz>2026-09-09 09:42:11 +0200
commit524678a063a9bee80ce07e66ddc0ee18af4e4622 (patch)
tree7ea0251a6bc1aca19d8ca76bb1ad97212a21c81b /tests/fixtures/simple.eml
parent67cd02eb7747977d5dac984f2e36b198852c267d (diff)
downloadabusectl-524678a063a9bee80ce07e66ddc0ee18af4e4622.tar.gz
abusectl-524678a063a9bee80ce07e66ddc0ee18af4e4622.zip
fix: refuse an ipv6 scope id, and say why a value was refused
Four holes of one class, all in the path that admits a query. ipaddress.ip_address accepts a scope id since Python 3.9, so "fe80::1%victim@example.org" passed _is_ip, is_queryable returned on that branch without inspecting the string further, and rdap.query_ip interpolated the whole thing into the query URL unquoted. A recipient identifier reached a registry, which is exactly the disclosure the fourth property exists to prevent and exactly what the domain-branch fix closed. Reject a scope id at the admission point. fe80::/10 is link-local and never a legitimate RDAP target anyway. The ip branch of worklist() dropped an unparseable value silently rather than funnelling it through add() like the other two branches, so a mangled indicator vanished from the manifest instead of showing up as unusable. It now goes through add(), and is_queryable grew the check that makes that classification correct: an all-digit last label is never a TLD, so "999.999.999.999" is a malformed IP rather than a host to ask a registry about. Two behaviours had no test and both mutations survived. _host_of's root-dot strip is now covered through the url branch, since failing to fold discloses one host to a registry twice; the .lower() half was dead work because urlsplit already lowercases, and is dropped with a comment saying so. The two-label requirement is asserted on is_queryable directly, because a single-label name matches no tld in the bootstrap and a resolve test could never fail whatever the validator decides. The refusal message named no reason, leaving a reviewer unable to tell whether the parser mangled a legitimate host or the attacker planted something. Two cases now: a non-ASCII name is plausibly a real IDN indicator to chase by hand, an illegal character is hostile. Also let KeyboardInterrupt and SystemExit through resolve()'s handler, so stopping a long run is not recorded as a failed query on whichever indicator was in flight. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wrfqr2xqQfhtXCscU7zrdz
Diffstat (limited to 'tests/fixtures/simple.eml')
0 files changed, 0 insertions, 0 deletions