Analyzing SAP Security Notes December 2014 Edition

High-profile risk threats identified by Onapsis Research Labs experts reveals that unauthorized users could access business-critical applications leveraging SAP BusinessObjects

SAP is a complex and ever changing system, whether because of changes introduced to your SAP implementation to better suit your business or through the application of Security Notes (Patches) to ensure that newly disclosed vulnerabilities are mitigated.

In order to provide a predictable and scheduled flow of vulnerability mitigation information and security patches, SAP releases the major part of their latest Security Notes information on the second Tuesday of every month. Due to this regular disclosure of new security issues that could potentially weaken the security of SAP systems within an organization, it’s highly recommended to carry out periodic assessments on a monthly basis at least.

At Onapsis we are very concerned about our client’s SAP system security and also the state of SAP security in general, so to assist our customers, we perform a detailed analysis of the monthly SAP Security Notes as soon as they are published. The goal of this is to provide SAP clients with detailed information about the newly released notes and vulnerabilities affecting their SAP systems and help guide their testing of these systems within their organization.

Between the last published SAP Security Tuesday and today, there were 28 SAP Security notes published by SAP (taking into account 3 Support Packages and 25 Patch Day Notes).

The plot graph illustrates the distribution of CVSS scores across the Security Notes released in December. The only notes taken into account to build it, were the ones to which SAP set a CVSS (14 out of the 28 SAP Security Notes). As you may observe in the graph, the SAP Security Notes this month have a range of values from 1.5 to 7.5 with a median of 3.9.

Continue reading

Share Button

A Closer Look at SAPGUI History

As most users of SAPGUI know, the application keeps a record of the values that are entered in each field. In the case of having to repeat the same entries multiple times, this is of course a great feature… or maybe not?

Let’s analyze this from a security viewpoint. There are two main questions to ask:

  1. What is being recorded in the history?
  2. Is the history record safely-guarded so none but SAPGUI can access it?

For the first question, we clearly don’t want to have sensitive data lying somewhere around our computers, and in an ERP environment, there is a lot of sensitive data stored. For example, information such as passwords (keep calm, hidden fields where you only see ‘***’ instead of letters do not get recorded), money amounts, bank account numbers, etc. may be being recorded in the history.

Now let’s dive into the second question. Is this information safely guarded? Here the answer is simply “no”. It doesn’t matter whether you are using SAPGUI in Unix or Windows, the recording mechanism changes, but it’s very easy to access and read your history knowing which files to look at.
Continue reading

Share Button

Understanding SAP CODVN H Algorithm

Today’s post will be focused on analyzing the inner workings of the SAP CODVN H algorithm.

Before jumping into the algorithm’s details I will highlight the most important features. For more information you can refer to the SAP security note 991968. The algorithm provides the following capabilities:

  • Support for multiple hashing algorithms (for the time being only salted SHA-1).
  • Supported password length up to 40 characters.
  • Upper and lower case passwords supported.
  • UTF-8 support.
  • Random salt, length can be configured.

Continue reading

Share Button

Bypassing SAP HANA XSS Filter

Last week we were doing some tests on the HANA XS engine trying to understand how an attacker could bypass the XSS filter provided by the ICM.

For what purpose?

As discussed in previous post, a Cross Site Scripting attack could be more effective than a SQL injection due to the SAP HANA inherent design. Continue reading

Share Button

Analyzing SAP Security Notes November 2014 Edition

SAP is a complex and ever changing system, whether because of changes introduced to your SAP implementation to better suit your business or through the application of Security Notes (Patches) to ensure that newly disclosed vulnerabilities are mitigated.

In order to provide a predictable and scheduled flow of vulnerability mitigation information and security patches, SAP releases the major part of their latest Security Notes information on the second Tuesday of every month. Due to this regular disclosure of new security issues that could potentially weaken the security of SAP systems within an organization, it’s highly recommended to carry out periodic assessments on a monthly basis at least.

At Onapsis we are very concerned about our client’s SAP system security and also the state of SAP security in general, so to assist our customers, we perform a detailed analysis of the monthly SAP Security Notes as soon as they are published. The goal of this is to provide SAP clients with detailed information about the newly released notes and vulnerabilities affecting their SAP systems and help guide their testing of these systems within their organization.

box-plot-November-2014This month, SAP published an unusually quantity of SAP Security Notes: 86 Security Notes (taking into account 65 Support Packages and 21 Patch Day Notes). It was mostly due to a new feature which enhance the security management of RFC Functions and fixes to missing authority check vulnerabilities.

The plot graph illustrates the distribution of CVSS scores across the Security Notes released in November. The only notes taken into account to make it, where the ones to which SAP set a CVSS (14 out of the 86 SAP Security Notes). As you may observe in the graph, the SAP Security Notes this month have a range of values from 3.5 to 10.0 with a median of 6.

Continue reading

Share Button

Switchable authorization checks and callback whitelists: A note on RFC security

This week SAP published a paper with the Monthly SAP Notes titled Securing Remote Function Calls (RFC) which outlines guidelines on the best practices to configure different RFC security features. In this post we will focus on two of the newest features in the paper:

  • Switchable Authorization Checks
  • RFC Callback White-lists

Switchable Authorization Checks

This new concept is related to a common problem while implementing SAP Notes or Support Packages, as stated in page 19 of the document:

Authorization checks that are newly introduced in existing RFC function modules through SAP Notes or through support packages can interrupt business-critical system communication if legitimate users do not have the newly introduced authorization.

 

To enable a nondisruptive evolution of authorization checks, SAP introduced switchable authorization checks in all software systems based on SAP NetWeaver AS for ABAP 7.0 and higher.

When an action is executed, let’s say through a transaction, the system checks that the user has the authorization object S_TCODE and then, inside the transaction code, the system should check for specific authorization objects related to the action to be executed.

Likewise, when an action is executed through an RFC function something similar must happen. In this case, the system should check for the authorization object S_RFC (this can be changed with the profile parameter auth/rfc_authority_check) instead of S_TCODE and also check for specific authorization objects related to the action to be executed.

For example:

Continue reading

Share Button

Logging IP addresses in the Security Audit Log

Hi! I was reviewing some events coming from the Security Audit Log and noticed an interesting behavior.

For those who never heard about it, the Security Audit Log (a.k.a SAL) allows SAP security administrators to keep track of the activities performed in their systems. In a future post we will discuss how to enable and configure it.

By default the SAL facility logs the “Terminal Name” which is either the Terminal Name defined by the computer which performed the logged action as the source of events; the “Terminal Name’ if no “Terminal Name” value is sent then the IP address of the computer performing the actions is used.

Continue reading

Share Button

Analyzing SAP Security Notes October 2014 Edition

UPDATE (November 4, 2014): Note 2043404 has been rereleased with an updated priority. The priority was increased from medium to very high. The new CVSS for this Note is 9.3 (AV:N/AC:M/AU:N/C:C/I:C/A:C)

SAP is a complex and ever-changing system. Between changes introduced to SAP implementation to improve your business, and the application of Security Notes (Patches) to ensure mitigation of newly disclosed vulnerabilities, SAP is constantly evolving.

In order to provide a scheduled flow of vulnerability mitigation information and security patches, SAP releases the majority of new Security Notes on the second Tuesday of each month. Due to this regular disclosure of security alerts warning against potentially harmful issues, it is highly recommended to carry out periodic assessments on a monthly basis (at minimum) to ensure that existing security on your SAP systems does not become weakened.

At Onapsis, we’re very concerned about our client’s SAP system security, as well as the state of SAP security in general. In order to best assist our customers, we perform a detailed analysis of the monthly SAP Security Notes as soon as they are published. The goal of this is to provide SAP clients with comprehensive information about the newly released notes and vulnerabilities affecting SAP systems, and to help guide testing of these systems within their organization.

This month 34 SAP Security Notes were published by SAP (taking into account 11 Support Packages and 23 Patch Day Notes). Additionally, there were changes on how SAP communicates vulnerabilities reported by external security researchers, as it previously wasn’t clear which were externally reported.

Five of the vulnerabilities fixed this month were discovered by members of the Onapsis Research Labs:

Here you have a plot graph illustrating the distribution of CVSS scores of the Security Notes released in October. The only notes taken into account where the ones for which SAP set a CVSS (19 out of the 34 SAP Security Notes). As you may observe in the graph, the SAP Security Notes this month have a range of values from 4.3 to 7.5 with a median of 6.4. Continue reading

Share Button

SAP Security Note 2067859 Potential Exposure to Digital Signature Spoofing

OVERVIEW

This week, SAP AG published a hot news item titled: “SAP Security Note 2067859 (Potential Exposure to Digital Signature Spoofing)”, which alerts users about a potential vulnerability in certain cryptographic libraries used in SAP NetWeaver Application Server ABAP and SAP HANA. By abusing these libraries, an attacker could potentially spoof (i.e., successfully masquerade as a legitimate user) Digital Signatures produced in vulnerable systems.

To ensure your SAP systems are not vulnerable, you should check that your crypto libraries versions are equal or higher than:

  • SAPCRYPTOLIB version 5.555.38
  • CommonCryptoLib version 8.4.30

Furthermore:
SAPSECULIB has been deprecated, and must be replaced by the latest SAPCRYPTOLIB version.

Stack kernel 720 PL#700 already comes with the fixed CommonCryptoLib

Note: As stated in the SAP Security Note 2067859, you should replace the DSA PSEs on all the involved SAP NetWeaver Application Server ABAP and SAP HANA systems. Also, remember to replace the system public keys in their signature trusting systems as an additional security measure.

Continue reading

Share Button

SAP HANA post exploitation vectors

This week the Onapsis Research Labs released an advisory for a server-side code injection vulnerability in SAP HANA integrated IDE. For more information about the SAP Note that fixes this issue, please refer to the Onapsis Research Labs advisory.

To define a reasonable exploitation scenario, we will assume the following conditions are met by our testing landscape:

  • There’s a vulnerable application running in our HANA instance.
  • The attacker has access to the vulnerable application.
  • The application is using a standard database user (created by default)

With this kind of vulnerability an attacker would able to inject arbitrary XSJS code that will run with the same privileges of the user running the application in the HANA server, this attack vector brings two powerful post exploitation primitives:

  1. Run arbitrary XSJS code.
  2. Perform an arbitrary SQL query.

By leveraging this vulnerability an attacker could execute SQL statements. For example he could execute something similar to:

var conn = $.db.getConnection();
var st = prepareStatement("SELECT * FROM USERS");

Continue reading

Share Button