Skip links

BSP Page Directive & , SAP security note 887168

Description

XSS attacks typically happen because of code that has roughly the following format:

<%@page language=”abap”%>
<html><body><form>
  <% data: x type string.
     x = request->get_form_field( ‘x’ ).
  %>
  <input type=text name=x value=”<%=x%>”>
  <input type=submit>
</form></body></html>

What we see here is that input is taken from the incoming HTTP request, not validated by the application, and then directly used in the rendered HTTP response. This allows a XSS attack whereby a HTTP request can be constructed that has also JavaScript inside some formfields, that are then rendered back to the user’s browser, and possibly executed there.

The simplest form of protection is to HTML encode all strings before rendering them.

One solution that is already supported, is that the developer can manually do an HTML encode on all strings.
  <% data: x type string.
     x = request->get_form_field( ‘x’ ).
     x = cl_http_utility=>html_encode( x ).
  %>
To make life easier for the developer, the BSP compiler has always also supported a build-in HTML encoding. This could be achieved by changing the print statement.

  <input type=text name=x value=”<%html=x%>”>

However, this writing form “<%html=…%>” must be used for each and every print statement and not be forgotten.

Note: while adding the feature described below, we observed and fixed a problem with the “<%html=…%>” sequence which would make it fail after the second and subsequent uses on a page. For this problem, Note Assisted corrections are supplied over all releases and service pack.s

Available fix and Supported packages

  • SAP_BASIS | 620 | 640
  • SAP_BASIS | 700 | 700
  • SAP_BASIS | 710 | 710
  • SAP_BASIS 640 | SAPKB64015 |
  • SAP_BASIS 620 | SAPKB62056 |
  • SAP_BASIS 700 | SAPKB70006 |
  • SAP_BASIS 620 | SAPKB62057 |

Affected component

    BC-BSP
    Business Server Pages

CVSS

Score: 0

PoC

Detailed vulnerability information added to RedRays Security Platform. Contact [email protected] for details.

URL

https://launchpad.support.sap.com/#/notes/887168

TAGS

#

Udemy SAP Security Course.

Join “SAP Security Core Concepts and Security Administration” which is part of the Blackhat course series. This course will help you master SAP security fundamentals, from securing SAP environments to managing user access and addressing vulnerabilities. It is ideal for IT professionals and SAP administrators, providing practical skills to safeguard critical business assets. Whether you’re a beginner or an expert looking to deepen your SAP security knowledge, this course is perfect for you.

More to explorer

SAP Hash Cracking Techniques

Understanding Hash Cracking Hashing is a one-way encryption technique employed to ensure data integrity, authenticate information, and secure passwords alongside other sensitive

SAP Security Patch Day – September 2024

As the second Tuesday of September 2024 approaches, SAP administrators and security professionals are preparing for another crucial event: SAP Security Patch

Special offer for SAP Security Udemy course!

$ 9.99

Join “SAP Security Core Concepts and Security Administration” which is part of the Blackhat course series.