question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Public suffix list is misused, yielding incorrect results

See original GitHub issue

I actually discovered this bug when using TldExtract and logged an issue in that repo. I’m posting the problem here as well because this library is (seemingly) actively maintained.

The problem is that the public suffix list is not a list of TLDs.

Repro code:

void Main()
{
    try
    {
        var parser = new DomainParser(new WebTldRuleProvider());
        Console.WriteLine(parser.Parse("https://s3.amazonaws.com"));
    }
    catch (Exception ex)
    {
        Console.WriteLine($"{ex.GetType().Name}: {ex.Message}");
    }
}

Console output:

ParseException: Domain is a TLD according publicsuffix

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tinohagercommented, Aug 10, 2022

Thank you you are welcome to use another project if this one does not meet your needs

0reactions
bhood-zoruscommented, Aug 10, 2022

Your library is fundamentally flawed with the assumption that the public suffix list is a list of TLDs. I have provided a laughably trivial example that proves that WebTldRuleProvider is completely unfit for real world use. If you’re okay with that, then I won’t add any further comments to this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Download of public suffix list fails · Issue #1294 · win-acme ...
Hi I try to create a new certificate for a domain. First I tried the interactive UI where I chose "Create new certificate...
Read more >
Public Suffix List
The Public Suffix List (PSL) is a catalog of certain Internet domain names. Entries on the list are also referred to as effective...
Read more >
Learn more about the Public Suffix List
The Public Suffix List is a cross-vendor initiative to provide an accurate list of domain name suffixes, maintained by the hard work of...
Read more >
draft-kucherawy-dmarc-base-13
Acquire a "public suffix" list, i.e., a list of DNS domain names reserved for ... DMARC evaluation can only yield a "pass" result...
Read more >
draft-dmarc-base-00-03.txt
Construct a new DNS domain name using the name that matched from the public suffix list and prefixing to it the "x+1"th label...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found