Skip to content
Snippets Groups Projects

fixup! Bug 30237: Add v3 onion services client authentication prompt

Merged morgan requested to merge morgan/tor-browser:bug_40465 into tor-browser-102.3.0esr-12.0-2
All threads resolved!
  • strip subdomain off of onion hostname when extracting the onion service id for use with the ONION_CLIENT_AUTH_ADD command

fixes #40465 (closed)

This function receives a hostname from an onon URI. I haven't tested this end-to-end but have verified the regex works as expected with the following:

const onionServiceIdRegExp = /^(.*\.)*(?<onionServiceId>[a-z2-7]{56})\.onion$/i;
// duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad
"duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion".match(onionServiceIdRegExp).groups.onionServiceId.toLowerCase();
"DUCKDUCKGOgg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion".match(onionServiceIdRegExp).groups.onionServiceId.toLowerCase();
"duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.ONION".match(onionServiceIdRegExp).groups.onionServiceId.toLowerCase();
"foo.FOO.duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion".match(onionServiceIdRegExp).groups.onionServiceId.toLowerCase();
// throws because of null due to not matching 
"".match(onionServiceIdRegExp).groups.onionServiceId.toLowerCase();
"www.cnn.com".match(onionServiceIdRegExp).groups.onionServiceId.toLowerCase();
"fake.onion".match(onionServiceIdRegExp).groups.onionServiceId.toLowerCase();

The 'Invalid v3 address...' error comes from the tor daemon itself (rather than Tor Browser), so it seems the original cypherpunk was spot-on in their diagnoses of the problem and this error most likely comes from the invalid arg to the ONION_CLIENT_AUTH_ADD command.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • henry resolved all threads

    resolved all threads

  • henry approved this merge request

    approved this merge request

  • ma1 mentioned in merge request !390 (closed)

    mentioned in merge request !390 (closed)

  • morgan added 20 commits

    added 20 commits

    • b8cfa021...caa59888 - 19 commits from branch tpo/applications:tor-browser-102.3.0esr-12.0-2
    • 400276c6 - fixup! Bug 30237: Add v3 onion services client authentication prompt

    Compare with previous version

  • morgan marked this merge request as draft from richard/tor-browser@400276c6

    marked this merge request as draft from richard/tor-browser@400276c6

  • morgan marked this merge request as ready

    marked this merge request as ready

  • Please register or sign in to reply
    Loading