CVE-2014-6283: Privilege Escalation Vulnerability and Potential Remote Code Execution in SAP Adaptiv
来源:互联网 发布:中国汽车年度销量数据 编辑:程序博客网 时间:2024/05/17 23:18
On May 12, 2014, SAP published updates to Adaptive Server Enterprise versions 15.0. 15.5 and 15.7 on all platforms. These updates addressed a security flaw in a built-in procedure implementation. The flaw allows any authenticated database user to overwrite the master encryption key or execute arbitrary code in the database server process context. Below I will discuss in detail what happens inside the server when the vulnerable procedure is invoked.
In the fall of 2013 I was researching various aspects of SAP ASE functionality and one thing that caught my attention was the SQL Debugger (sqldbgr.jar
) using undocumented built-in procedures likedbgrpc_attach
, dbgrpc_detach
and so on. This opened up a whole set of internal undocumented procedures many of which are publicly callable. I performed further analysis by simply calling each procedure, which revealed that some were vulnerable to buffer overflows and other types of attack.
SAP Adaptive Server Enterprise has many built-in procedures that are callable using stored procedure calls by ordinary database users. One of them is named hacmpmsgxchg
and is supposedly responsible for some of the High Availability functionality. In unpatched versions of ASE this procedure is publicly callable. The procedure's code fails to handle invalid user input: if the parameters passed to the procedure are specially crafted, the procedure will either overwrite the server's master encryption key or will trigger stack-based buffer overflow that allows for arbitrary code execution.
The master encryption key (if set) is used to protect other encryption keys. Overwriting the master key will replace the valid master key with an attacker-provided key. This problem happens because internally the procedure calls another one that sets the master key and both have no permission checks.
The other variation of this attack will run attacker-supplied code on the server. To illustrate this vulnerability here is a piece of pseudo-code that mimics the procedure beginning:
Here a1
and a2
are user-controlled parameters passed to the procedure. So the Size
variable is taken from user input, as is Src
, and then is used in the memcpy
call to local (stack-based) buffer Dst
of 2048
bytes, a classic stack-based overflow condition.
An interesting point is that in its first attempt to fix this issue SAP added some more checks inside the function, but it was still possible to bypass them using a more sophisticated exploit technique. Finally SAP fixed this issue properly. Our advisory includes information about the necessary patches per version.
There is no workaround for this issue: database administrators must apply the patch. This is because the procedure in question is internal, undocumented and has no mechanism to set permissions or to disable it.
Vulnerable versions are: 15.0.3 below ESD#4.4, 15.5 below ESD#5.4, 15.7 below SP122 (SP62).
More information:
- SAP published a document on this issue: https://service.sap.com/sap/support/notes/2044220
- Trustwave advisory: https://www3.trustwave.com/spiderlabs/advisories/TWSL2014-013.txt
Trustwave's database security products ensure that all necessary patches are applied to database servers to prevent this type of attack.
- CVE-2014-6283: Privilege Escalation Vulnerability and Potential Remote Code Execution in SAP Adaptiv
- QSEE privilege escalation vulnerability and exploit (CVE-2015-6639)
- SAP Netweaver 'SAPHostControl' Service Remote Code Execution Vulnerability
- Vulnerability in Graphics Rendering Engine Allows Remote Code Execution
- Script Execution and Privilege Escalation on Jenkins Server
- SAP MaxDB versions 7.6.03 suffer from a pre-authentication remote code execution vulnerability.
- Debian 'login' Local Privilege Escalation Vulnerability
- Linux Kernel 'fasync_helper()' Local Privilege Escalation Vulnerability
- Linux Kernel 'fasync_helper()' Local Privilege Escalation Vulnerability
- Joomla! 1.6/1.7/2.5 Privilege Escalation Vulnerability
- TrustZone Kernel Privilege Escalation (CVE-2016-2431)
- Microsoft Windows SMB2 '_Smb2ValidateProviderCallback()' Remote Code Execution Vulnerability
- Citrix Provisioning Services 'streamprocess.exe' Component Remote Code Execution Vulnerability
- Advisory: Oracle Forms 10g Unauthenticated Remote Code Execution (CVE-2014-4278)
- CVE-2015-2342 – Remote Code Execution within VMware vCenter
- CVE-2014-7911: Android <5.0 Privilege Escalation using ObjectInputStream (权限提升漏洞)
- Linux Kernel 'pipe.c' Local Privilege Escalation Vulnerability
- Linux Kernel Controller Area Network Protocol Local Privilege Escalation Vulnerability
- 浅析单调队列
- Jsoup抓取图片功能代码学习
- PHP中用jQuery 的操作POST方法提交数据(用login测试)
- Android 用Gradle构建你的Android程序
- Java 从基础到进阶学习之路---类编写以及文档注释.
- CVE-2014-6283: Privilege Escalation Vulnerability and Potential Remote Code Execution in SAP Adaptiv
- HDU 4821 String 解题报告(哈希)
- 【学习4】Cocos2d-x 常用控件之Sprite
- 浅析连续子向量,子数组和(一维,二维)问题
- 背包算法问题
- 《Systems Performance: Enterprise and the Cloud》读书笔记系列(三) —— 第二章(二)
- [android]Mac OS环境下真机调试的环境配置
- Android:ListView常见错位之CheckBox错位
- Flume-ng+Kafka+storm的学习笔记