28.01.2013 Views

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

9.2.3 Server-Side JavaScript Security Considerations<br />

If you choose to use server-side JavaScript to write your application code, you need to bear in mind the potential<br />

for (and risk of) external attacks such as cross-site scripting and forgery, and insufficient authentication.<br />

The following list illustrates the areas where special attention is required to avoid security-related problems when<br />

writing server-side JavaScript. Each of the problems highlighted in the list is described in detail in its own section:<br />

● SSL/HTTPS<br />

● Injection flaws<br />

● Cross-site scripting (XSS)<br />

● Broken authentication and session management<br />

● Insecure direct object references<br />

● Cross-site request forgery<br />

● Incorrect security configuration<br />

● Insecure cryptographic storage<br />

● Missing restrictions on URL Access<br />

● Insufficient transport layer protection<br />

● Invalidated redirects and forwards<br />

● XML processing issues<br />

Inbound HTTPS/SSL Connections<br />

● Problem<br />

Incoming requests for data from client applications use secure HTTP (HTTPS), but the <strong>SAP</strong> <strong>HANA</strong> system is<br />

not configured to accept the HTTPS requests.<br />

● Solution<br />

Ensure the <strong>SAP</strong> Web Dispatcher is configured to accept incoming HTTPS requests. For more information, see<br />

the <strong>SAP</strong> <strong>HANA</strong> Administration <strong>Guide</strong>.<br />

Note: The HTTPS requests are forwarded internally from the <strong>SAP</strong> Web Dispatcher to <strong>SAP</strong> <strong>HANA</strong> XS as<br />

HTTP (clear text).<br />

Injection Flaws<br />

● Problem<br />

In the context of <strong>SAP</strong> <strong>HANA</strong> XS, injection flaws mostly concern SQL injection, which can occur in the <strong>SAP</strong><br />

<strong>HANA</strong> XS JavaScript API or SQL script itself (both standard and dynamic).<br />

● Solution<br />

214<br />

To prevent injection flaws in the JavaScript API, use prepared statements to create a query and place-holders<br />

to fill with results of function calls to the prepared-statement object; to prevent injection flaws in standard<br />

SQL Script, use stored procedures that run in caller mode; in caller mode, the stored procedures are<br />

executed with the credentials of the logged-on <strong>HANA</strong> user. Avoid using dynamic SQL if possible.<br />

P U B L I C<br />

© 2012 <strong>SAP</strong> AG. All rights reserved.<br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Developer</strong> <strong>Guide</strong><br />

Writing Server-Side JavaScript Applications

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!