Synopsis
Tenable has discovered two vulnerabilities in Cisco’s Unified Computing System Platform Emulator 3.0.2cPE1 command line interface. Both are exploitable over SSH (authentication is required). The emulator ships with SSH enabled and a default username and password of ‘ucspe’. This account, and the functionality implemented, is designed not to allow access to the local file system other than the files or resources explicitly required.
#1) ucspe-copy Command Line Argument Handling Command Injection
One of the commands available in the ‘CLI shell’ is the ucspe-copy command, which takes two arguments (file name, location to send file to). Using this command, it appears that a direct call to /usr/bin/scp is being used through a system() call. After testing, it was determined that that command does not handle quotes properly. Additionally, the command parser splits the arguments on unescaped spaces only. This, combined with the fact that the second parameter relies on the input starting with 'ftp', 'scp', 'sftp', or 'tftp'. Using these observations, arbitrary commands can be injected.
#2) libclimeta.so Filename Argument Handling Local Heap Buffer Overflow
The ucspe-copy command is also vulnerable to a heap overflow vulnerability. Specifically, if the first argument exceeds 241 characters then the program will write outside of the allocated buffer. The first argument is calling the /ape/ape/opt/sam/bin/ucssh program. Specifically, the library that processes the ucspe-copy input and executes system() (as well as the free() that triggered this crash) is libclimeta.so.
Solution
Cisco has released version 3.1 which addresses these issues.
Additional References
https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20160414-ucspe1https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20160414-ucspe2
https://communities.cisco.com/docs/DOC-37827
http://www.cisco.com/c/en/us/td/docs/ios/fundamentals/command/reference/cf_book.html
Disclosure Timeline
All information within TRA advisories is provided “as is”, without warranty of any kind, including the implied warranties of merchantability and fitness for a particular purpose, and with no guarantee of completeness, accuracy, or timeliness. Individuals and organizations are responsible for assessing the impact of any actual or potential security vulnerability.
Tenable takes product security very seriously. If you believe you have found a vulnerability in one of our products, we ask that you please work with us to quickly resolve it in order to protect customers. Tenable believes in responding quickly to such reports, maintaining communication with researchers, and providing a solution in short order.
For more details on submitting vulnerability information, please see our Vulnerability Reporting Guidelines page.
If you have questions or corrections about this advisory, please email [email protected]