Public Vulnerability Reports

QNX Neutrino RTOS libph PHOTON_PATH Buffer Overflow Vulnerability



QNX Software Systems Ltd.'s Neutrino RTOS (QNX) is a real-time operating
system designed for use in embedded systems. More information is
available at:


Local exploitation of a stack-based buffer overflow vulnerability in QNX
Inc.'s Neutrino RTOS Operating System allows local attackers to gain
root privileges.

The vulnerability specifically exists due to improper handling of
environment variables in the libph system library. The libph system
library is utilized by various setuid applications that utilize the
Photon API. The setitem() function fails to check bounds on the
PHOTON_PATH environment variable prior to a strcpy operation. An
attacker can supply an overly long value for PHOTON_PATH to overflow the
stack buffer and overwrite the return address as shown here:

Breakpoint 1, 0xb0343624 in strcpy ()
from /usr/qnx630/target/qnx6/x86/lib/
(gdb) bt
#0 0xb0343624 in strcpy () from /usr/qnx630/target/qnx6/x86/lib/
#1 0xb826f58b in setitem ()
from /usr/qnx630/target/qnx6/x86/usr/lib/
#2 0xb826f7ec in additems ()
from /usr/qnx630/target/qnx6/x86/usr/lib/
#3 0xb826ffa9 in list_modify ()
from /usr/qnx630/target/qnx6/x86/usr/lib/
#4 0xb82ef2fe in PtSetValue ()
from /usr/qnx630/target/qnx6/x86/usr/lib/
#5 0xb82c7ceb in PtCompoundSetResources ()
from /usr/qnx630/target/qnx6/x86/usr/lib/
#6 0xb82ed018 in PtSetResources ()
from /usr/qnx630/target/qnx6/x86/usr/lib/
#7 0xb8244bf3 in set_list_res ()
from /usr/qnx630/target/qnx6/x86/usr/lib/
#8 0xb82ef2fe in PtSetValue ()
from /usr/qnx630/target/qnx6/x86/usr/lib/
#9 0xb82c7ceb in PtCompoundSetResources ()
from /usr/qnx630/target/qnx6/x86/usr/lib/
#10 0xb82ed018 in PtSetResources ()
from /usr/qnx630/target/qnx6/x86/usr/lib/
#11 0x0804db32 in main ()
#12 0x44444444 in ?? ()

Attackers can supply a specially crafted value to overflow the buffer
and execute arbitrary code.


Successful exploitation of the vulnerability allows local attackers to
gain root privileges. The libph library is a core system library on
Neutrino RTOS, however it has had a number of trivial vulnerabilities
similar to this one.


iDefense has confirmed the existence of this vulnerability on QNX
Neutrino RTOS 6.3.0. All versions are suspected vulnerable.


As a workaround solution, remove the setuid bit from any programs linked
to An example is shown here:

# ls -l /usr/photon/bin/phlocale
-rwsrwxr-x 1 root root 54244 May 05 2004 /usr/photon/bin/phlocale
# ldd /usr/photon/bin/phlocale
/usr/photon/bin/phlocale: => /usr/lib/ (0xb8200000) => /usr/lib/ (0xb8210000) => /usr/lib/ (0xb8312000) => /lib/ (0xb8347000) => /lib/ (0xb8363000) => /usr/lib/ (0xb0300000)
# chmod -s /usr/photon/bin/phlocale


This issue has been corrected in QNX Momentics 6.3.0 SP3 and later versions. Patches are also available for 6.3.0 (Patch ID:230), 6.3.0 SP1 (Patch ID:231), and 6.3.0 SP2 (Patch ID:232). Please contact your QNX representative, or visit to obtain these patches.


A Mitre Corp. Common Vulnerabilities and Exposures (CVE) number has not
been assigned yet.


12/15/2005 Initial vendor notification
02/07/2006 Public disclosure


iDefense credits Filipe Balestra ( with the
discovery of this vulnerability.

Get paid for vulnerability research

Free tools, research and upcoming events


Copyright © 2006 Verisign, Inc.

Permission is granted for the redistribution of this alert
electronically. It may not be edited in any way without the express
written consent of iDefense. If you wish to reprint the whole or any
part of this alert in any other medium other than electronically, please
email for permission.

Disclaimer: The information in the advisory is believed to be accurate
at the time of publishing based on currently available information. Use
of the information constitutes acceptance for use in an AS IS condition.
There are no warranties with regard to this information. Neither the
author nor the publisher accepts any liability for any direct, indirect,
or consequential loss or damage arising from use of, or reliance on,
this information.