SecurityTracker.com
    Home    |    View Topics    |    Search    |    Contact Us    |   

SecurityTracker
Archives


 


Category:   Application (Web Server/CGI)  >   Pwc CGI Vendors:   Kojdecki, Radoslaw
Pwc CGI Code May Execute Arbitrary Code Supplied Via the Web
SecurityTracker Alert ID:  1001157
SecurityTracker URL:  http://securitytracker.com/id/1001157
CVE Reference:   GENERIC-MAP-NOMATCH   (Links to External Site)
Date:  Mar 26 2001
Impact:   Execution of arbitrary code via network


Description:   There is reportedly a format string bug in the "pwc" password change CGI code.

According to the report, pwc uses the writelog() to call the syslog() function, which can be used by a remote user to send executable shellcode into the variable buffers[512]. The syslog() function will then execute the code.

The pwc code is available at:

ftp://ftp.media-com.com.pl/pub/other/pwc.tar.gz

Impact:   A remote use can send executable code to the web server's "pwc" cgi code and pwc will execute the code with the privileges of the web server.
Solution:   No vendor solution was available at the time of this entry. The author of the source message recommends a patch (see the source message for more information).
Cause:   Input validation error
Underlying OS:  Linux (Any), UNIX (Any), Windows (Any)

Message History:   None.


 Source Message Contents

Subject:  another format string bug


There is a format string bug in 'pwc' (ftp://ftp.media-com.com.pl/pub/other/pwc.tar.gz).
This CGI script is used to change users password via www (blah!).
writelog() call syslog() function, which 'eats' ;)  characters and log it
to system logs. But you can paste shellcode into buffers[512] and syslog()
will run it without any problems.

void writelog(const char *fmt, ...)
{
	va_list args;
	char buffers[512];

	va_start(args, fmt);

	openlog(SERVICENAME, LOG_PID | LOG_CONS | LOG_NOWAIT | LOG_AUTH);
	vsnprintf(buffer, 512, fmt, args);
	syslog(LOG_ERR, buffer); <- bug :)
	closelog();
	return;
	va_end(args);
}

As you can see this is potential security bug.

Patch:

	change
		syslog(LOG_ERR, buffer);
	to
		syslog(LOG_ERR, "%s", buffer);

greetz: #sigsegv, #phreakpl, #argante

-------------------------------------------------------------------
Wojtek Pawlikowski <wojtek@liderlink.net> Linux / BSD Administrator
Cell 0608521666 || Registered Linux User 198985 || Have a nice trip


 
 


Go to the Top of This SecurityTracker Archive Page





Home   |    View Topics   |    Search   |    Contact Us

This web site uses cookies for web analytics. Learn More

Copyright 2021, SecurityGlobal.net LLC