[UNIX] XChat /dns Command Execution Vulnerability

From: support@securiteam.com
Date: 03/28/02


From: support@securiteam.com
To: list@securiteam.com
Date: Thu, 28 Mar 2002 12:55:12 +0100 (CET)

The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion

When was the last time you checked your server's security?
How about a monthly report?
http://www.AutomatedScanning.com - Know that you're safe.
- - - - - - - - -

  XChat /dns Command Execution Vulnerability
------------------------------------------------------------------------

SUMMARY

 <http://www.xchat.org/> XChat is an IRC client for UNIX operating
systems. I.R.C. is Internet Relay Chat, see <http://irchelp.org>
http://irchelp.org for more information about IRC in general. A security
vulnerability in the product allows attackers to cause the program to
execute arbitrary commands.

DETAILS

There is an issue by the way XChat handle the /exec command, and more
accurately in the /dns command. The /dns should resolve the host of
somebody, by issuing the command "/dns some_nick" and program actually
executes it via string replacement ("%s %s"), where the first string
replaced is the DNS program name (filename), and the second is the
hostname of the person you want to resovle.

Looking into the code of the program, i.e. the cmd_dns() function, you
will find the following around common/outbound.c line 1474
{
 sprintf (tbuf, "/exec %s %s", prefs.dnsprogram, nick);
 handle_command (tbuf, sess, 0, 0);
}

And far away, at line 1863 in the cmd_exec() function:
 execl ("/bin/sh", "sh", "-c", cmd, 0);

No dangerous characters are stripped out of cmd, allowing an attacker to
force a server to respond to DNS query with
";DISPLAY=localhost:0.0;xterm". This would cause the command passed to the
execl function to be as follows: "host;DISPLAY=localhost:0.0;xterm", which
as you probably guessed it will execute an arbitrary command.

To exploit the hole, the attacker would need to force a server to respond
to a whois command with a malformed DNS response.

Migrating factors:
 * An attacker must run his own specially patched server.
 * An attacker has to cause the user to the /dns command on someone.

ADDITIONAL INFORMATION

The information has been provided by <mailto:spacewalker@altern.org>
SpaceWalker.

========================================

This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com

====================
====================

DISCLAIMER:
The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.



Relevant Pages

  • Re: << SBS News of the week - Sept 26 >>
    ... > And he points to the info you need to put the file on the server in the ... > at the network perimeter. ... The Symantec Firewall/VPN and the Gateway Security ... An attacker can exploit these flaws in tandem via specially ...
    (microsoft.public.backoffice.smallbiz2000)
  • Re: << SBS News of the week - Sept 26 >>
    ... > And he points to the info you need to put the file on the server in the ... > at the network perimeter. ... The Symantec Firewall/VPN and the Gateway Security ... An attacker can exploit these flaws in tandem via specially ...
    (microsoft.public.windows.server.sbs)
  • [REVS] Combating Reverse Telnet using OpenBSD Packet Filter
    ... Beyond Security would like to welcome Tiscali World Online ... could give you access to the files in the server that is running DragonFly ... The attacker can simply implant or upload backdoor ... block in quick on $EXTIF inet proto tcp from any to any flags FUP/FUP ...
    (Securiteam)
  • [NEWS] Oracle9i Application Server Format String Vulnerability
    ... Beyond Security would like to welcome Tiscali World Online ... Oracle's 9i Application Server offers a highly functional web server ... If an attacker uses ... NGSSoftware alerted Oracle to this vulnerability on 24 September 2002. ...
    (Securiteam)
  • Re: Problem with psftp in .NET.
    ... Now, if your goal is copy files from server to client's FTP site, then why ... security perspective, this is very ill-advised. ... As i told before that command is running fine through command prompt ... administrator user. ...
    (microsoft.public.dotnet.general)