[FD] Securing SAP Systems from XSS vulnerabilities Part 2: Defense for SAP NetWeaver ABAP

2015-06-24 Thread Darya Maenkova


From the developer’s perspective

For all generic Web applications where you accept input parameters, you 
must use encoding methods provided by the ICF handler. The 
implementation of the encoding is available as an API in two variants:


•ABAP built-in function ESCAPE (available as of SAP_BASIS = 731);

•Class implementation in CL_ABAP_DYN_PRG.

In releases higher or equal to SAP NetWeaver Release 7.0 enhancement 
package 3 (SAP_BASIS = 731), use the ABAP built-in function ESCAPE(). 
For more information, see the ABAP keyword documentation for the 
ESCAPE() function.


HTML / XML



out = escape(val = val format = cl_abap_format=e_xss_ml).

JavaScript



out = escape(val = val format = cl_abap_format=e_xss_js)

URL



out = escape(val = val format = cl_abap_format=e_xss_url)

CSS



out = escape(val = val format = cl_abap_format=e_xss_css)

For lower releases (SAP_BASIS 702, 720 and below), there is an ABAP OO 
implementation. The implementation is in class CL_ABAP_DYN_PRG.


Context



Method

HTML / XML



out = CL_ABAP_DYN_PRG=ESCAPE_XSS_XML_HTML(val)

JavaScript



out = CL_ABAP_DYN_PRG=ESCAPE_XSS_JAVASCRIPT(val)

URL



out = CL_ABAP_DYN_PRG=ESCAPE_XSS_URL(val)

CSS



out = CL_ABAP_DYN_PRG=ESCAPE_XSS_CSS(val)

For more information about the delivery of these extensions, see SAP 
Security Note 1582870 [4].



 For WebDynpro ABAP

For WebDynpro ABAP, you do not have to care about XSS at all. The 
security is ensured through the framework itself.



 For Business Server Pages (BSP)

For BSP, you should use the page directives. For more information, see 
SAP Security Note 1600317 [5] and SAP Security Note 1638779 [6]. These 
BSP page attributes have the advantage that the BSP framework ensures 
that the most secure version of encoding is used.


For BSP, you should use the page directives: /%@page language=abap 
forceEncode=html|url|javascript|css% /


After importing SAP Security Note 1600317 [7], the existing page 
directives also use the updated BSP compiler that supports HTML encoding 
of all print statements on the page.


In the following example, all print statements use HTML encoding. It 
only affects print statements on BSP pages and does not have anything to 
do with tag parameter passing that uses the same syntax, but has 
different semantics.


BSP example:

%@page language=abap forceEncode=html%

htmlbodyform

% data: inputvalue type string.

inputvalue = request-get_form_field( 'x' ).

%

input type=text name=x value=%=inputvalue%

input type=submit

/form/body/html

The global page attribute defines the default encoding used within the 
page and all included page fragments. Besides the global page 
attributes, you can use the following notations for controlling the 
encoding behavior of a special print event (overriding the global 
settings):


•%html=...%: HTML encoding

•%url=...%: URL encoding for parameter names or values of URLs

•%javascript=...%: JavaScript encoding

•%css=…% : CSS encoding

•%raw=...% (no encoding, that is, a global encoding that was set in 
the page directive is switched off)


Using forceEncode within a page directive in a page fragment has no 
effect. The encoding within page fragments is always controlled by the 
including page.



   For BSP Online Text Repository (OTR)

One aspect that is similar to an XSS attack is a translation-related 
change that breaks the HTML or JavaScript code.//


Example: script

var msg = 'otrHello/otr';

/script

input name=xyz value=otrReplace 'dog' with 'cat'/otr

Therefore, there is an extra page attribute that you can set. When this 
attribute is set, all OTR texts are effectively encoded directly after 
they have been retrieved in their language-dependent form.


For BSP ORT, you should use the page directives:

/%@page language=abap forceEncodeOtr=html|javascript%/HTML example

//%@page language=abap forceEncodeOtr=html%

scriptvar msg = 'otrHello/otr';alert(msg);

/script

JavaScript example

%@page language=abap forceEncodeOtr=html%

script

var msg = '%JavaScript=otrHello/otr%';

alert(msg);

/script


   For BSP Extensions

For the BSP HTMLB library, you must set the attribute forceEncode of the 
htmlb:content tag to ENABLED to switch on the internal encoding 
because it is set to disabled by default. ENABLED means that the 
extension will use an appropriate encoding depending on the context 
within a value is used:


/htmlb:content forceEncode=ENABLED|BACKWARDS_COMPATIBLE/

•ENABLED: This means to always encode everything. This overwrites all 
other encode attributes and they no longer have to be set;


•BACKWARDS_COMPATIBLE: This is the default value. The usual encode 
attributes are active as previously defined.


In addition, the attribute design of htmlb:content specifies the 
possible designs as a page supports. Valid values are CLASSIC, 
DESIGN2002, DESIGN2003, or DESIGN2008, or combinations separated by a 
plus (+) 

[FD] ERPSCAN Research Advisory [ERPSCAN-15-003] SAP NetWeaver Dispatcher Buffer Overflow - RCE, DoS

2015-06-23 Thread Darya Maenkova
ERPSCAN Research Advisory [ERPSCAN-15-003] SAP NetWeaver Dispatcher 
Buffer Overflow - RCE, DoS


Application:SAP NetWeaver Dispatcher
Versions Affected:SAP NetWeaver Dispatcher, probably others
Vendor URL:http://SAP.com
Bugs:   RCE
Sent:   25.08.14
Reported:   25.08.14
Vendor response:25.08.14
Date of Public Advisory:15.02.2015
Reference:SAP Security Note 2063369
Author:George Nosenko (ERPScan)


Description


1. ADVISORY INFORMATION
Title: SAP NetWeaver Dispatcher
Advisory ID: [ERPSCAN-05-003]
Risk: Hight
Advisory URL: 
http://erpscan.com/advisories/erpscan-15-003-sapkernel-c_sapgparam-rce-dos/

Date published: 18.06.2015
Vendors contacted: SAP


2. VULNERABILITY INFORMATION
Class: Buffer overflow  [CWE-119], [CWE-20]
Impact: Allows an unauthorized attacker to execute remote code
Remotely Exploitable: Yes
Locally Exploitable: No
CVE Name: CVE-2015-2815


3. VULNERABILITY DESCRIPTION
SAP NetWeaver Dispatcher has the function sapac01_sapgparam() that 
processes the ABAP kernel call C_SAPGPARAM. This function has a buffer 
overflow vulnerability. The vulnerability can allow an authenticated 
remote attacker to execute arbitrary code. It can also lead to denial of 
service.



4. VULNERABLE PACKAGES
•  SAP KERNEL 7.00 32BIT, disp+work.exe (7000.52.12.34966)
•  SAP KERNEL 7.40 64BIT, disp+work.exe (7400.12.21.30308)
Other versions are probably affected too, but they were not checked.


5. SOLUTIONS AND WORKAROUNDS
To correct this vulnerability, install SAP Security Note 2063369.


6. AUTHOR
George Nosenko (ERPScan)


7. TECHNICAL DESCRIPTION
The vulnerability in SAP NetWeaver Dispatcher can allow an authenticated 
remote attacker to execute arbitrary code. It can also lead to denial of 
service.



8. REPORT TIMELINE
Sent:25.08.2014
Reported:25.08.2014
Vendor response:26.08.2014
Date of Public Advisory:18.06.2015


9. REFERENCES
http://erpscan.com/advisories/erpscan-15-003-sapkernel-c_sapgparam-rce-dos/


10. ABOUT ERPScan Research
The company’s expertise is based on the research subdivision of ERPScan, 
which is engaged in vulnerability research and analysis of critical 
enterprise applications. It has achieved multiple acknowledgments from 
the largest software vendors like SAP, Oracle, Microsoft, IBM, VMware, 
HP for discovering more than 400 vulnerabilities in their solutions (200 
of them just in SAP!).
ERPScan researchers are proud to have exposed new types of 
vulnerabilities (TOP 10 Web Hacking Techniques 2012) and to be nominated 
for the best server-side vulnerability at BlackHat 2013.
ERPScan experts have been invited to speak, present, and train at 60+ 
prime international security conferences in 25+ countries across the 
continents. These include BlackHat, RSA, HITB, and private SAP trainings 
in several Fortune 2000 companies.
ERPScan researchers lead the project EAS-SEC, which is focused on 
enterprise application security research and awareness. They have 
published 3 exhaustive annual award-winning surveys about SAP security.
ERPScan experts have been interviewed by leading media resources and 
featured in specialized info-sec publications worldwide. These include 
Reuters, Yahoo, SC Magazine, The Register, CIO, PC World, DarkReading, 
Heise, and Chinabyte, to name a few.
We have highly qualified experts in staff with experience in many 
different fields of security, from web applications and mobile/embedded 
to reverse engineering and ICS/SCADA systems, accumulating their 
experience to conduct the best SAP security research.



11. ABOUT ERPScan
ERPScan is one of the most respected and credible Business Application 
Security providers. Founded in 2010, the company operates globally. 
Named an Emerging vendor in Security by CRN and distinguished by more 
than 25 other awards, ERPScan is the leading SAP SE partner in 
discovering and resolving security vulnerabilities. ERPScan consultants 
work with SAP SE in Walldorf to improve the security of their latest 
solutions.
ERPScan’s primary mission is to close the gap between technical and 
business security. We provide solutions to secure ERP systems and 
business-critical applications from both cyber attacks and internal 
fraud. Our clients are usually large enterprises, Fortune 2000 
companies, and managed service providers whose requirements are to 
actively monitor and manage the security of vast SAP landscapes on a 
global scale.
Our flagship product is ERPScan Security Monitoring Suite for SAP. This 
multi award-winning innovative software is the only solution on the 
market certified by SAP SE covering all tiers of SAP security: 
vulnerability assessment, source code review, and Segregation of Duties. 
The largest companies from diverse industries like oil and gas, banking, 
retail, even nuclear power installations as well as consulting companies 
have successfully 

[FD] ERPSCAN Research Advisory [ERPSCAN-15-004] SAP NetWeaver Portal XMLValidationComponent - XXE

2015-06-23 Thread Darya Maenkova
ERPSCAN Research Advisory [ERPSCAN-15-004] SAP NetWeaver Portal 
XMLValidationComponent - XXE



Application:SAP NetWeaver Portal 7.31
Versions Affected:SAP NetWeaver Portal 7.31, probably others
Vendor URL:http://SAP.com
Bugs:XML eXternal Entity
Sent:06.11.2014
Reported:06.11.2014
Vendor response:07.11.2014
Date of Public Advisory:18.06.2015
Reference:SAP Security Note 2098608
Author:Vahagn Vardanyan (ERPScan)


Description


1. ADVISORY INFORMATION
Title: SAP NetWeaver Portal 7.31
Advisory ID: [ERPSCAN-15-004]
Risk: High
Advisory URL: 
http://erpscan.com/advisories/erpscan-15-004-sap-netweaver-portal-xmlvalidationcomponent-xxe/

Date published: 15.02.2015
Vendors contacted: SAP


2. VULNERABILITY INFORMATION
Class: XML External Entity [CWE-611]
Impact: read file, upload file, DoS, information disclosure
Remotely Exploitable: Yes
Locally Exploitable: No
CVE Name: CVE-2015-2812


3. VULNERABILITY DESCRIPTION
The problem is caused by a program error in 'ValidationComponent' due to 
the incorrect use of an XML parser.
By default, the parser opens external entities referenced within an XML 
input, which can then lead to malicious content being parsed.

This malicious content can reference internal resources, such as files.
These internal resources can be disclosed in the response to the 
request, or can be used to perform a denial of service attack on the 
parsing system, rendering the application content temporarily unavailable.



4. VULNERABLE PACKAGES
SAP NetWeaver Portal 7.31
Other versions are probably affected too, but they were not checked.


5. SOLUTIONS AND WORKAROUNDS
To correct this vulnerability, install SAP Security Notes 2098608 and 
2093966.



6. AUTHOR
Vahagn Vardanyan (ERPScan)


7. TECHNICAL DESCRIPTION
SAP XML parser (parserXMLValidationComponent) validates all incoming XML 
requests with a user-specified DTD.



8. REPORT TIMELINE
Sent:06.11.2014
Reported:   06.11.2014
Vendor response:07.11.2014
Date of Public Advisory:18.06.2015


9. REFERENCES
http://erpscan.com/advisories/erpscan-15-004-sap-netweaver-portal-xmlvalidationcomponent-xxe/


10. ABOUT ERPScan Research
The company’s expertise is based on the research subdivision of ERPScan, 
which is engaged in vulnerability research and analysis of critical 
enterprise applications. It has achieved multiple acknowledgments from 
the largest software vendors like SAP, Oracle, Microsoft, IBM, VMware, 
HP for discovering more than 400 vulnerabilities in their solutions (200 
of them just in SAP!).
ERPScan researchers are proud to have exposed new types of 
vulnerabilities (TOP 10 Web Hacking Techniques 2012) and to be nominated 
for the best server-side vulnerability at BlackHat 2013.
ERPScan experts have been invited to speak, present, and train at 60+ 
prime international security conferences in 25+ countries across the 
continents. These include BlackHat, RSA, HITB, and private SAP trainings 
in several Fortune 2000 companies.
ERPScan researchers lead the project EAS-SEC, which is focused on 
enterprise application security research and awareness. They have 
published 3 exhaustive annual award-winning surveys about SAP security.
ERPScan experts have been interviewed by leading media resources and 
featured in specialized info-sec publications worldwide. These include 
Reuters, Yahoo, SC Magazine, The Register, CIO, PC World, DarkReading, 
Heise, and Chinabyte, to name a few.
We have highly qualified experts in staff with experience in many 
different fields of security, from web applications and mobile/embedded 
to reverse engineering and ICS/SCADA systems, accumulating their 
experience to conduct the best SAP security research.



11. ABOUT ERPScan
ERPScan is one of the most respected and credible Business Application 
Security providers. Founded in 2010, the company operates globally. 
Named an Emerging vendor in Security by CRN and distinguished by more 
than 25 other awards, ERPScan is the leading SAP SE partner in 
discovering and resolving security vulnerabilities. ERPScan consultants 
work with SAP SE in Walldorf to improve the security of their latest 
solutions.
ERPScan’s primary mission is to close the gap between technical and 
business security. We provide solutions to secure ERP systems and 
business-critical applications from both cyber attacks and internal 
fraud. Our clients are usually large enterprises, Fortune 2000 
companies, and managed service providers whose requirements are to 
actively monitor and manage the security of vast SAP landscapes on a 
global scale.
Our flagship product is ERPScan Security Monitoring Suite for SAP. This 
multi award-winning innovative software is the only solution on the 
market certified by SAP SE covering all tiers of SAP security: 
vulnerability assessment, source code review, and Segregation of 

[FD] ERPSCAN Research Advisory [ERPSCAN-15-005] SAP Mobile Platform - XXE

2015-06-23 Thread Darya Maenkova

ERPSCAN Research Advisory [ERPSCAN-15-005] SAP Mobile Platform - XXE


Application:SAP Mobile Platform 2.3
Versions Affected:SAP Mobile Platform 2.3, probably others
Vendor URL:http://SAP.com
Bugs:XML eXternal Entity
Sent:06.11.14
Reported:06.11.14
Vendor response:07.11.14
Date of Public Advisory:18.06.2015
Reference:SAP Security Note 2125358
Author:Dmitry Chastukhin (ERPScan)


Description


1. ADVISORY INFORMATION
Title: SAP Mobile Platform 2.3
Advisory ID: [ERPSCAN-15-005]
Risk: High
Advisory URL: 
http://erpscan.com/advisories/erpscan-15-005-sap-mobile-platform-xxe/

Date published: 15.02.2015
Vendors contacted: SAP


2. VULNERABILITY INFORMATION
Class: XML External Entity [CWE-611]
Impact: information disclosure, denial of service, read file
Remotely Exploitable: Yes
Locally Exploitable: No
CVE Name: CVE-2015-2813


3. VULNERABILITY DESCRIPTION
1) An attacker can read an arbitrary file on the server by sending a 
correct XML request with a crafted DTD to/scc/messagebroker/http and 
reading the reply from the service.
2) An attacker can perform a DoS attack (for example, an XML Entity 
Expansion attack)
3) A SMB Relay attack is a type of Man-in-the-Middle attack where the 
attacker asks the victim to authenticate into a machine controlled by 
the attacker, then relays the credentials to the target. The attacker 
forwards the authentication information both ways, giving them access.



4. VULNERABLE PACKAGES
SAP Mobile Platform 2.2
SAP Mobile Platform 2.3
Other versions are probably affected too, but they were not checked.


5. SOLUTIONS AND WORKAROUNDS
To correct this vulnerability, install SAP Security Note 2125358 or:
* Upgrade your existing SMP 2.2 installation to SMP 2.2 SP06 PL02
* Upgrade your existing SMP 2.3 installatoin to SMP 2.3 SP05 PL01


6. AUTHOR
Dmitry Chastuin (ERPScan)


7. TECHNICAL DESCRIPTION
SAP XML parser (/scc/messagebroker/http) validates all incoming XML 
requests with a user-specified DTD.



8. REPORT TIMELINE
Sent:06.11.14
Reported:07.11.14
Vendor response:07.11.14
Date of Public Advisory:18.06.2015


9. REFERENCES
http://erpscan.com/advisories/erpscan-15-005-sap-mobile-platform-xxe/


10. ABOUT ERPScan Research
The company’s expertise is based on the research subdivision of ERPScan, 
which is engaged in vulnerability research and analysis of critical 
enterprise applications. It has achieved multiple acknowledgments from 
the largest software vendors like SAP, Oracle, Microsoft, IBM, VMware, 
HP for discovering more than 400 vulnerabilities in their solutions (200 
of them just in SAP!).
ERPScan researchers are proud to have exposed new types of 
vulnerabilities (TOP 10 Web Hacking Techniques 2012) and to be nominated 
for the best server-side vulnerability at BlackHat 2013.
ERPScan experts have been invited to speak, present, and train at 60+ 
prime international security conferences in 25+ countries across the 
continents. These include BlackHat, RSA, HITB, and private SAP trainings 
in several Fortune 2000 companies.
ERPScan researchers lead the project EAS-SEC, which is focused on 
enterprise application security research and awareness. They have 
published 3 exhaustive annual award-winning surveys about SAP security.
ERPScan experts have been interviewed by leading media resources and 
featured in specialized info-sec publications worldwide. These include 
Reuters, Yahoo, SC Magazine, The Register, CIO, PC World, DarkReading, 
Heise, and Chinabyte, to name a few.
We have highly qualified experts in staff with experience in many 
different fields of security, from web applications and mobile/embedded 
to reverse engineering and ICS/SCADA systems, accumulating their 
experience to conduct the best SAP security research.



11. ABOUT ERPScan
ERPScan is one of the most respected and credible Business Application 
Security providers. Founded in 2010, the company operates globally. 
Named an Emerging vendor in Security by CRN and distinguished by more 
than 25 other awards, ERPScan is the leading SAP SE partner in 
discovering and resolving security vulnerabilities. ERPScan consultants 
work with SAP SE in Walldorf to improve the security of their latest 
solutions.
ERPScan’s primary mission is to close the gap between technical and 
business security. We provide solutions to secure ERP systems and 
business-critical applications from both cyber attacks and internal 
fraud. Our clients are usually large enterprises, Fortune 2000 
companies, and managed service providers whose requirements are to 
actively monitor and manage the security of vast SAP landscapes on a 
global scale.
Our flagship product is ERPScan Security Monitoring Suite for SAP. This 
multi award-winning innovative software is the only solution on the 
market certified by SAP SE covering all tiers of SAP security: 
vulnerability 

[FD] ERPSCAN Research Advisory [ERPSCAN-15-008] SAP Afaria 7 XcListener - DoS in the module XeClient.Dll

2015-06-23 Thread Darya Maenkova
https://www.linkedin.com/company/2217474?trk=ppro_cprofERPSCAN 
Research Advisory [ERPSCAN-15-008] SAP Afaria 7 XcListener - DoS in the 
module XeClient.Dll


Application:SAP Afaria 7
Versions Affected:SAP Afaria 7, probably others
Vendor URL:http://SAP.com
Bugs:DoS
Sent:09.12.2014
Reported:09.12.2014
Vendor response:10.12.2014
Date of Public Advisory:18.06.2015
Reference:SAP Security Note 2132584
Author:Vahagn Vardanyan (ERPScan)


Description


1. ADVISORY INFORMATION
Title: SAP Afaria 7 XcListener - DoS
Advisory ID: [ERPSCAN-15-008]
Risk: High
Advisory URL: 
http://erpscan.com/advisories/erpscan-15-008-sap-afaria-7-xclistener-buffer-overflow

Date published: 15.03.2015
Vendors contacted: SAP


2. VULNERABILITY INFORMATION
Class: DoS [CWE-400]
Impact: DoS
Remotely Exploitable: Yes
Locally Exploitable: No
CVE Name: CVE-2015-2820


3. VULNERABILITY DESCRIPTION
It is possible to use denial of service to terminate the process of the 
vulnerable component. As a result, nobody can use this service, which 
has a negative influence on business processes. System downtime also 
harms business reputation.



4. VULNERABLE PACKAGES
SAP Afaria 7
Other versions are probably affected too, but they were not checked.


5. SOLUTIONS AND WORKAROUNDS
A vulnerability has been discovered in certain landscape configurations 
of SAP Afaria that utilize XcListener for initiating client-to-server 
communications.  SAP has released security patches for the vulnerable 
clients, Windows Mobile, Windows CE, and Windows. Windows Phone is not 
affected. SAP strongly recommends that customers patch their servers.


Patching instructions:
1)  Download hotfix
1. SAP Afaria 7 SP5 Hotfix 8
2. SAP Afaria 7 SP4 Hotfix 16
2)  Apply server hotfix
The server version of XcListener will be patched when the hotfix is 
applied. The clients will be updated through the Afaria ESD process as 
they connect to the server.



6. AUTHOR
Vahagn Vardanyan (ERPScan)


7. TECHNICAL DESCRIPTION
An anonymous attacker can use a special request to crash the XcListener 
process on the server.



8. REPORT TIMELINE
Sent:09.12.2014
Reported:   09.12.2014
Vendor response:10.12.2014
Date of Public Advisory:18.06.2015


9. REFERENCES
http://erpscan.com/advisories/erpscan-15-008-sap-afaria-7-xclistener-buffer-overflow


10. ABOUT ERPScan Research
The company’s expertise is based on the research subdivision of ERPScan, 
which is engaged in vulnerability research and analysis of critical 
enterprise applications. It has achieved multiple acknowledgments from 
the largest software vendors like SAP, Oracle, Microsoft, IBM, VMware, 
HP for discovering more than 400 vulnerabilities in their solutions (200 
of them just in SAP!).
ERPScan researchers are proud to have exposed new types of 
vulnerabilities (TOP 10 Web Hacking Techniques 2012) and to be nominated 
for the best server-side vulnerability at BlackHat 2013.
ERPScan experts have been invited to speak, present, and train at 60+ 
prime international security conferences in 25+ countries across the 
continents. These include BlackHat, RSA, HITB, and private SAP trainings 
in several Fortune 2000 companies.
ERPScan researchers lead the project EAS-SEC, which is focused on 
enterprise application security research and awareness. They have 
published 3 exhaustive annual award-winning surveys about SAP security.
ERPScan experts have been interviewed by leading media resources and 
featured in specialized info-sec publications worldwide. These include 
Reuters, Yahoo, SC Magazine, The Register, CIO, PC World, DarkReading, 
Heise, and Chinabyte, to name a few.
We have highly qualified experts in staff with experience in many 
different fields of security, from web applications and mobile/embedded 
to reverse engineering and ICS/SCADA systems, accumulating their 
experience to conduct the best SAP security research.



11. ABOUT ERPScan
ERPScan is one of the most respected and credible Business Application 
Security providers. Founded in 2010, the company operates globally. 
Named an Emerging vendor in Security by CRN and distinguished by more 
than 25 other awards, ERPScan is the leading SAP SE partner in 
discovering and resolving security vulnerabilities. ERPScan consultants 
work with SAP SE in Walldorf to improve the security of their latest 
solutions.
ERPScan’s primary mission is to close the gap between technical and 
business security. We provide solutions to secure ERP systems and 
business-critical applications from both cyber attacks and internal 
fraud. Our clients are usually large enterprises, Fortune 2000 
companies, and managed service providers whose requirements are to 
actively monitor and manage the security of vast SAP landscapes on a 
global scale.
Our flagship product is ERPScan Security Monitoring Suite 

[FD] ERPSCAN Research Advisory [ERPSCAN-15-011] SAP Mobile Platform 3.0 - XXE

2015-06-23 Thread Darya Maenkova

ERPSCAN Research Advisory [ERPSCAN-15-011] SAP Mobile Platform 3.0 - XXE

Application:SAP Mobile Platform 3.0
Versions Affected:SAP Mobile Platform 3.0, probably others
Vendor URL:http://SAP.com
Bugs:XML eXternal Entity
Sent:29.12.2014
Reported:   29.12.2014
Vendor response:30.12.2014
Date of Public Advisory:18.06.2015
Reference:SAP Security Note 2125513
Author:Vahagn Vardanyan (ERPScan)


Description


1. ADVISORY INFORMATION
Title: SAP Mobile Platform 3.0 XXE
Advisory ID: [ERPSCAN-15-011]
Risk: High
Advisory URL: 
http://erpscan.com/advisories/erpscan-15-011-sap-mobile-platform-xxe/

Date published: 15.03.2015
Vendors contacted: SAP


2. VULNERABILITY INFORMATION
Class: XML External Entity [CWE-611]
Impact: XML external entity, information disclosure, denial of service
Remotely Exploitable: Yes
Locally Exploitable: No


3. VULNERABILITY DESCRIPTION
The problem is caused by a program error in SAP Mobile Platform 3.0 due 
to the incorrect use of an XML parser (/mobiliser servlet).
By default, the parser opens external entities referenced within an XML 
input, which can then lead to malicious content being parsed.

This malicious content can reference internal resources, such as files.
These internal resources can be disclosed in the response to the 
request, or can be used to perform a denial of service attack on the 
parsing system, rendering the application content temporarily unavailable.



4. VULNERABLE PACKAGES
SAP Mobile Platform 3.0
Other versions are probably affected too, but they were not checked.


5. SOLUTIONS AND WORKAROUNDS
To correct this vulnerability, install SAP Security Note 2125513.


6. AUTHOR
Vahagn Vardanyan (ERPScan)


7. TECHNICAL DESCRIPTION
SAP XML parser validates all incoming XML requests with a user-specified 
DTD.



8. REPORT TIMELINE
Sent:29.12.2014
Reported:29.12.2014
Vendor response:30.12.2014
Date of Public Advisory:18.06.2015


9. REFERENCES
http://erpscan.com/advisories/erpscan-15-011-sap-mobile-platform-xxe/


10. ABOUT ERPScan Research
The company’s expertise is based on the research subdivision of ERPScan, 
which is engaged in vulnerability research and analysis of critical 
enterprise applications. It has achieved multiple acknowledgments from 
the largest software vendors like SAP, Oracle, Microsoft, IBM, VMware, 
HP for discovering more than 400 vulnerabilities in their solutions (200 
of them just in SAP!).
ERPScan researchers are proud to have exposed new types of 
vulnerabilities (TOP 10 Web Hacking Techniques 2012) and to be nominated 
for the best server-side vulnerability at BlackHat 2013.
ERPScan experts have been invited to speak, present, and train at 60+ 
prime international security conferences in 25+ countries across the 
continents. These include BlackHat, RSA, HITB, and private SAP trainings 
in several Fortune 2000 companies.
ERPScan researchers lead the project EAS-SEC, which is focused on 
enterprise application security research and awareness. They have 
published 3 exhaustive annual award-winning surveys about SAP security.
ERPScan experts have been interviewed by leading media resources and 
featured in specialized info-sec publications worldwide. These include 
Reuters, Yahoo, SC Magazine, The Register, CIO, PC World, DarkReading, 
Heise, and Chinabyte, to name a few.
We have highly qualified experts in staff with experience in many 
different fields of security, from web applications and mobile/embedded 
to reverse engineering and ICS/SCADA systems, accumulating their 
experience to conduct the best SAP security research.



11. ABOUT ERPScan
ERPScan is one of the most respected and credible Business Application 
Security providers. Founded in 2010, the company operates globally. 
Named an Emerging vendor in Security by CRN and distinguished by more 
than 25 other awards, ERPScan is the leading SAP SE partner in 
discovering and resolving security vulnerabilities. ERPScan consultants 
work with SAP SE in Walldorf to improve the security of their latest 
solutions.
ERPScan’s primary mission is to close the gap between technical and 
business security. We provide solutions to secure ERP systems and 
business-critical applications from both cyber attacks and internal 
fraud. Our clients are usually large enterprises, Fortune 2000 
companies, and managed service providers whose requirements are to 
actively monitor and manage the security of vast SAP landscapes on a 
global scale.
Our flagship product is ERPScan Security Monitoring Suite for SAP. This 
multi award-winning innovative software is the only solution on the 
market certified by SAP SE covering all tiers of SAP security: 
vulnerability assessment, source code review, and Segregation of Duties. 
The largest companies from diverse industries like oil and gas, banking, 
retail, even nuclear power 

[FD] ERPSCAN Research Advisory [ERPSCAN-15-010] SYBASE SQL Anywhere 12 and 16 - DoS

2015-06-23 Thread Darya Maenkova
ERPSCAN Research Advisory [ERPSCAN-15-010] SYBASE SQL Anywhere 12 and 16 
- DoS


Application:SYBASE SQL Anywhere 12 and 16
Versions Affected:SYBASE SQL Anywhere 12 and 16, probably others
Vendor URL:http://SAP.com
Bugs:DoS
Sent:09.12.2014
Reported:   09.12.2014
Vendor response:10.12.2014
Date of Public Advisory:18.06.2015
Reference:  SAP Security Note 2108161
Author: Vahagn Vardanyan (ERPScan)


Description


1. ADVISORY INFORMATION
Title: SYBASE SQL Anywhere 12 and 16 - DoS
Advisory ID: [ERPSCAN-15-010]
Risk: High
Advisory URL: 
http://erpscan.com/advisories/erpscan-15-010-sybase-sql-anywhere-11-and-16-dos/

Date published: 15.03.2015
Vendors contacted: SAP


2. VULNERABILITY INFORMATION
Class: DoS [CWE-122]
Impact: DoS
Remotely Exploitable: Yes
Locally Exploitable: No
CVE Name: CVE-2015-2819


3. VULNERABILITY DESCRIPTION
An attacker can trigger a condition in which the process ceases to run. 
This condition can be intentionally provoked by an attacker to cause 
denial of service.



4. VULNERABLE PACKAGES
SYBASE SQL Anywhere 12 and 16
Other versions are probably affected too, but they were not checked.


5. SOLUTIONS AND WORKAROUNDS
To correct this vulnerability, install SAP Security Note 2108161.


6. AUTHOR
Vahagn Vardanyan (ERPScan)


7. TECHNICAL DESCRIPTION
An anonymous attacker can use a special request to crash the Sybase SQL 
Anywhere process on the server.



8. REPORT TIMELINE
Sent:09.12.2014
Reported:   09.12.2014
Vendor response:10.12.2014
Date of Public Advisory:18.06.2015


9. REFERENCES
http://erpscan.com/advisories/erpscan-15-010-sybase-sql-anywhere-11-and-16-dos/


10. ABOUT ERPScan Research
The company’s expertise is based on the research subdivision of ERPScan, 
which is engaged in vulnerability research and analysis of critical 
enterprise applications. It has achieved multiple acknowledgments from 
the largest software vendors like SAP, Oracle, Microsoft, IBM, VMware, 
HP for discovering more than 400 vulnerabilities in their solutions (200 
of them just in SAP!).
ERPScan researchers are proud to have exposed new types of 
vulnerabilities (TOP 10 Web Hacking Techniques 2012) and to be nominated 
for the best server-side vulnerability at BlackHat 2013.
ERPScan experts have been invited to speak, present, and train at 60+ 
prime international security conferences in 25+ countries across the 
continents. These include BlackHat, RSA, HITB, and private SAP trainings 
in several Fortune 2000 companies.
ERPScan researchers lead the project EAS-SEC, which is focused on 
enterprise application security research and awareness. They have 
published 3 exhaustive annual award-winning surveys about SAP security.
ERPScan experts have been interviewed by leading media resources and 
featured in specialized info-sec publications worldwide. These include 
Reuters, Yahoo, SC Magazine, The Register, CIO, PC World, DarkReading, 
Heise, and Chinabyte, to name a few.
We have highly qualified experts in staff with experience in many 
different fields of security, from web applications and mobile/embedded 
to reverse engineering and ICS/SCADA systems, accumulating their 
experience to conduct the best SAP security research.



11. ABOUT ERPScan
ERPScan is one of the most respected and credible Business Application 
Security providers. Founded in 2010, the company operates globally. 
Named an Emerging vendor in Security by CRN and distinguished by more 
than 25 other awards, ERPScan is the leading SAP SE partner in 
discovering and resolving security vulnerabilities. ERPScan consultants 
work with SAP SE in Walldorf to improve the security of their latest 
solutions.
ERPScan’s primary mission is to close the gap between technical and 
business security. We provide solutions to secure ERP systems and 
business-critical applications from both cyber attacks and internal 
fraud. Our clients are usually large enterprises, Fortune 2000 
companies, and managed service providers whose requirements are to 
actively monitor and manage the security of vast SAP landscapes on a 
global scale.
Our flagship product is ERPScan Security Monitoring Suite for SAP. This 
multi award-winning innovative software is the only solution on the 
market certified by SAP SE covering all tiers of SAP security: 
vulnerability assessment, source code review, and Segregation of Duties. 
The largest companies from diverse industries like oil and gas, banking, 
retail, even nuclear power installations as well as consulting companies 
have successfully deployed the software. ERPScan Security Monitoring 
Suite for SAP is specifically designed for enterprises to continuously 
monitor changes in multiple SAP systems. It generates and analyzes 
trends in user friendly dashboards, manages risks, tasks, and can export 
results to external 

[FD] SAP Security Notes May 2015

2015-05-22 Thread Darya Maenkova
 server and client SAP applications use the vulnerable compression 
algorithm LZC/LZH:


 * SAP NetWeaver Application Server ABAP
 * SAP NetWeaver Application Server Java
 * SAP NetWeaver RFC SDK
 * SAP RFC SDK
 * SAP GUI
 * SAP MaxDB database
 * SAPCAR archive tool

They are also used in the following protocols:

 * Diag
 * RFC
 * MaxDB

Let’s look at the found vulnerabilities in detail.

*1. Stack-based overflow vulnerability CVE-2015-2282 in compression 
algorithm LZC*


Vulnerable application code:

|/[..]/
int CsObjectInt::CsDecomprLZC (SAP_BYTE * inbuf,
SAP_INT inlen,
SAP_BYTE * outbuf,
SAP_INT outlen,
SAP_INT option,
SAP_INT * bytes_read,
SAP_INT * bytes_written)
[..]
/* Generate output characters in reverse order ...*/
while (code = 256)
{
*stackp++ = TAB_SUFFIXOF(code);
overflow
code = TAB_PREFIXOF(code);
}
[..]|


Note that the variable code contains an attacker-controlled value, 
which results in a stack overflow if the value is greater than 256 and 
the value of the code in the prefix table is also greater than 256. It's 
possible to fill the stack with arbitrary values by controlling the 
values stored in the prefix and suffix tables.


*2. Vulnerability CVE-2015-2278 in compression algorithm LZH*

Using this vulnerability, an attacker can read data stored outside the 
buffer using special package data.


Vulnerable code:

|/[..]/
int CsObjectInt::BuildHufTree (
unsigned * b, /* code lengths in bits (all assumed = BMAX) */
unsigned n, /* number of codes (assumed = N_MAX) */
unsigned s, /* number of simple-valued codes (0..s-1) */
int * d, /* list of base values for non-simple codes */
int * e, /* list of extra bits for non-simple codes */
HUFTREE **t, /* result: starting table */
int * m) /* maximum lookup bits, returns actual */
[..]
if (p = v + n)
{
r.e = INVALIDCODE; /* out of values--invalid code */
}
else if (*p  s)
{ /* 256 is end-of-block code */
r.e = (unsigned char)(*p  256 ? LITCODE : EOBCODE);
r.v.n = (unsigned short) *p; /* simple code is just the value*/
p++;
}
else
{
r.e = (unsigned char) e[*p - s]; /*non-simple,look up in lists*/
r.v.n = (unsigned short) d[*p - s];
p++;
}
[..]|


As you can see, arrays 'e' and 'd' are indexed by the values of * p - 
s. As the value of variables 'p' and 's' are under the attacker’s 
control, they also control the values of arrays 'e' and 'd'.


*Attack scenarios*

As the vulnerability affects a large number of SAP products, there are 
multiple attack vectors depending on how the vulnerable code is used in 
an SAP program.


Examples of vectors:

 * Attack on a server component: SAP NetWeaver services Gateway and
   Dispatcher process compressed data. An attacker can forge requests,
   create a special attack package, and exploit a Remote Code Execution
   vulnerability on the server.

 * Attack on a client component: the attacker can create a special .CAR
   or .SAR package, send it to a client, and when they try to unarchive
   it, the attacker’s commands will be executed on the client's host.

 * MitM attack. As most of the services affected by these issues are
   not encrypted by default, an attacker might be able to perform a
   man-in-the-middle attack and trigger the vulnerabilities by
   injecting malicious packets within the communication.

*Remediation*

SAP customers can implement security notes 2124806, 2121661, 2127995, 
2125316 at the company's support portal.


SAP has traditionally issued acknowledgments to the security researchers 
on theirwebsite http://scn.sap.com/docs/DOC-8218.


--

Darya Maenkova

PR manager

https://www.linkedin.com/company/2217474?trk=ppro_cprof 
https://twitter.com/erpscan


http://erpscan.com/



e-mail: d.maenk...@erpscan.com mailto:d.maenk...@erpscan.com

address: 228 Hamilton Avenue, Fl. 3, Palo Alto, CA. 94301

phone: 650.798.5255

erpscan.com http://erpscan.com


___
Sent through the Full Disclosure mailing list
https://nmap.org/mailman/listinfo/fulldisclosure
Web Archives  RSS: http://seclists.org/fulldisclosure/

[FD] SAP vulnerabilities highlighted in many reports such as HP Cyber Risk Report 2015

2015-05-08 Thread Darya Maenkova
Recently, HP published their yearly Cyber Risk Report 2015 
(http://info.hpenterprisesecurity.com/LP_460192_Cross_CyberriskFullReport_0315_gate 
).  Having many typical things spotlighted in this report such as 
growing number of ATM and IOT Security buzz you can find everywhere, 
ERPScan found some parts which are relevant to business application 
security. We have prepared deep article from this research, add all 
details and also collected information from different sources about 
growing number of SAP vulnerabilities and recent initiatives in helping 
SAP users to avoid issues (new security guidelines).


http://erpscan.com/press-center/blog/sap-vulnerabilities-highlighted-in-many-reports-such-as-hp-cyber-risk-report-2015/#more-7858


--

Darya Maenkova

PR manager

https://www.linkedin.com/profile/public-profile-settings?trk=prof-edit-edit-public_profile 
https://twitter.com/d_maenkova


http://erpscan.com/



e-mail: d.maenk...@erpscan.com mailto:d.maenk...@erpscan.com

address: 228 Hamilton Avenue, Fl. 3, Palo Alto, CA. 94301

phone: 650.798.5255

erpscan.com http://erpscan.com


___
Sent through the Full Disclosure mailing list
https://nmap.org/mailman/listinfo/fulldisclosure
Web Archives  RSS: http://seclists.org/fulldisclosure/