Skip Menu |

This queue is for tickets about the Net-DNS CPAN distribution.

Report information
The Basics
Id: 67602
Status: resolved
Priority: 0/
Queue: Net-DNS

People
Owner: Nobody in particular
Requestors: mmaslano [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.71
Fixed in: (no value)



Subject: system configuration is used instead of user defined
If I define my own configuration file, system files are used, which could be security issue. Example: My configuration file is defined as: my $res = Net::DNS::Resolver->new(config_file => '/my/dns.conf'); These files are read even if I defined my own file: /etc/resolv.conf $HOME/.resolv.conf ./.resolv.conf Last 2 files shouldn't be read by default since it's possible security issue - user can drop .resolv.conf pointing to malicious dns server. This issue was found during testing spamassassin with selinux. For details see: https://bugzilla.redhat.com/show_bug.cgi?id=628866#c2
Hi Marcela, A solution (which would not break current behaviour) would be to initialize the default values on the first instantiation of a Net::DNS::Resolver in stead of at module load time which it does now. The initialization from system files should then be postponed when Net::DNS::Resolver->new is called with an config_file argument. I will try to schedule this fix for the 0,68 release. Thanks for reporting the issue, -- Willem
From: Mark.Martinec [...] ijs.si
I think the level of this PR should be elevated to 'security'. There should be an easy and well documented way to disable Net::DNS from looking in a current working directory and a user's home directory. Better yet, these two should be disabled by default - only a platform-specific config file should be consulted by default, the same as the system's resolver(3) library routines (or equivalent) do. I wonder how many perl applications do a cwd to some world-writable (or application-writable) temporary directory and invoke a Net::DNS::Resolver from there, unaware of the danger lurking there.
On Thu 08 Nov 2012 13:25:25, Mark.Martinec@ijs.si wrote: Show quoted text
> I wonder how many perl applications do a cwd to some > world-writable (or application-writable) temporary directory > and invoke a Net::DNS::Resolver from there, unaware of > the danger lurking there.
Well... have you noticed that they will only be read when they are owned by the real user id of the running process? I quote from Net::DNS::Resolver documentation: Files except for /etc/resolv.conf must be owned by the effective userid running the program or they won't be read. In addition, several environment variables can also contain configuration information; see /ENVIRONMENT.
From: rwfranks [...] acm.org
On Wed Apr 20 03:33:38 2011, mmaslano@redhat.com wrote: [snip] Show quoted text
> my $res = Net::DNS::Resolver->new(config_file => '/my/dns.conf'); > > These files are read even if I defined my own file: > /etc/resolv.conf > $HOME/.resolv.conf > ./.resolv.conf
From 0.76, configuration files will no longer be read at module load time. If a config file is specified, no other files will be read.
Fixed in 0.76