Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"<name" is parsed as a valid domain #22

Closed
3 tasks done
WaLLy3K opened this issue May 1, 2017 · 1 comment
Closed
3 tasks done

"<name" is parsed as a valid domain #22

WaLLy3K opened this issue May 1, 2017 · 1 comment

Comments

@WaLLy3K
Copy link

WaLLy3K commented May 1, 2017

In raising this issue, I confirm the following:

  • I have read and understood the contributors guide.
  • The issue I am reporting can be replicated
  • The issue I am reporting isn't a duplicate

How familiar are you with the codebase?:

0


[BUG] Expected Behaviour:
When browsing the WebUI or retrieving stats directly from FTL, all the results returned should be domain names

[BUG] Actual Behaviour:
Once in a while, <name is returned as a domain name

[BUG] Steps to reproduce:
No idea. I have seen this occur on multiple days, and I definitely don't have IPv6 enabled on any of my devices or routing hardware.

Log file output
From /var/log/pihole.log:

May  1 05:37:38 dnsmasq[26983]: query[A] Helios from 10.0.0.6
May  1 05:37:38 dnsmasq[26983]: /etc/hosts Helios is 10.0.0.6
May  1 05:37:38 dnsmasq[26983]: query[AAAA] Helios from 10.0.0.6
May  1 05:37:38 dnsmasq[26983]: cached Helios is NODATA-IPv6
May  1 05:37:38 dnsmasq[26983]: query[A] <name unprintable> from 10.0.0.6
May  1 05:37:38 dnsmasq[26983]: forwarded <name unprintable> to 123.456.789.112
May  1 05:37:38 dnsmasq[26983]: validation result is SECURE

Device specifics

Hardware Type: Raspberry Pi 3B
OS: DietPi v149

@DL6ER
Copy link
Member

DL6ER commented May 1, 2017

I see that there is a domain sanitization routine in dnsmasq's code:

/* There can be names in the cache containing control chars, don't 
   mess up logging or open security holes. */
static char *sanitise(char *name)
{
  unsigned char *r;
  if (name)
    for (r = (unsigned char *)name; *r; r++)
      if (!isprint((int)*r))
	return "<name unprintable>";

  return name;
}

which can return <name unprintable> instead of the real domain name if the name contains control characters (for whatever reason). Even though FTL handles this domain name correctly as, when looking at the debug output

[2017-05-01 12:56:15.208] New domain: <name unprintable> (679/1000)
[2017-05-01 12:56:15.218] New client: 10.0.0.6 (7/10)

is shown, actually the web interface seems to mess up things here as it does not expect any blank spaces in the domain name (this is also why you see only <name in the tables).

This behavior could be fixed in two ways:

  1. Ignore the lines that contain <name unprintable> as domain altogether
  2. Dig through the web interface code and try to identify what has to be changed.

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

No branches or pull requests

2 participants