Skip to content

feat(domain): parse tel: links and normalise the number to dial - #2

Merged
DeepDiver1975 merged 2 commits into
chore/bootstrapfrom
feat/domain-tel-uri
Oct 26, 2026
Merged

DeepDiver1975 merged 2 commits into
chore/bootstrapfrom
feat/domain-tel-uri

Conversation

@DeepDiver1975

@DeepDiver1975 DeepDiver1975 commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #1, review only the commits after it.

The number in a tel: link comes from whatever page or document was clicked, and everything after ATD is executed by the phone. So TelUri is the trust boundary:

  • RFC 3966 tel: (scheme case-insensitive, tel:// tolerated), percent-decoded, visual separators dropped (- . ( ), space, no-break space, /), printed +49 (0)89 handled, parameters (;ext=, ;isub=, ;phone-context=) kept off the number.
  • Result is digits, or + followed by digits. Anything else is refused: * and # (on a landline *21*<number># sets up call forwarding at the exchange — second commit), %0D%0AATH, %3BATH, \r\n, NUL, letters, a + that is not leading, more than 32 digits, a link over 256 characters (checked before decoding), and a control character in any parameter.

DialNumber.From turns +<home country> into 0…, any other + into 00…, and prepends the Amtsholung prefix. DialSettings validates both (country code 1–3 digits without a leading 0, prefix at most 4 digits) and From throws ArgumentException on invalid settings.

63 tests, written before the code; make ci green.

🤖 Generated with Claude Code

DeepDiver1975 and others added 2 commits October 26, 2026 21:35
TelUri reduces an RFC 3966 link to 0-9 * # with an optional leading +,
dropping visual separators, the printed "(0)" and all parameters. Since
whatever follows ATD is executed by the phone, a link carrying a line
break, a semicolon or any other character is refused, as is one longer
than 32 digits or 256 characters.

DialNumber turns +<home country> into a leading 0, any other + into 00,
and prepends the Amtsholung prefix from DialSettings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Thomas Müller <[email protected]>
On a landline a supplementary-service code such as *21*<number># sets up
call forwarding at the exchange. A link carrying one would divert every
call to the Feuerwehr's line, behind a confirm window that shows what
looks like a number. Links, and the Amtsholung prefix, are now digits
only; the attack is replayed in plain and percent-encoded form.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Thomas Müller <[email protected]>
@DeepDiver1975
DeepDiver1975 merged commit b0548b3 into chore/bootstrap Oct 26, 2026
3 checks passed
@DeepDiver1975
DeepDiver1975 deleted the feat/domain-tel-uri branch October 26, 2026 20:48
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.

1 participant