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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Cross-site scripting (XSS)<br />

● Problem<br />

Cross-site scripting is a web-based vulnerability that involves an attacker injecting JavaScript into a link with<br />

the intention of running the injected code on the target computer; the vulnerability comes in two types:<br />

reflected (or non-persistent) and stored (or persistent). The "reflected" vulnerability affects individual users<br />

in their local Web browser; the "stored" vulnerability is stored on a server and affects all users who visit the<br />

served page.<br />

● Solution<br />

Since there are currently no libraries provided by the standard <strong>SAP</strong> <strong>HANA</strong> XS API to provide proper escaping,<br />

the best solution for generating HTML on <strong>SAP</strong> <strong>HANA</strong> XS is to use the E<strong>SAP</strong>I JavaScript libraries as a start<br />

point. In addition, we recommend not to write custom interfaces but to rely on well-tested technologies<br />

supplied by <strong>SAP</strong>, for example, OData or JSON together with <strong>SAP</strong>UI5 libraries.<br />

Broken authentication and session management<br />

● Problem<br />

Leaks or flaws in the authentication or session management functions allow attackers to impersonate users;<br />

the attackers can be external as well as users with their own accounts to get privileges of those users.<br />

● Solution<br />

Use the built-in <strong>SAP</strong> <strong>HANA</strong> XS authentication mechanism and session management (cookies). For example,<br />

use the "authentication" keyword to enable an authentication method and set it according to the<br />

authentication method you want implement, for example: <strong>SAP</strong> logon ticket, form-based, or basic (user name<br />

and password) in the application's .xsaccess file, which ensures that all objects in the application path are<br />

available only to authenticated users.<br />

Insecure direct object references<br />

● Problem<br />

An <strong>SAP</strong> <strong>HANA</strong> XS application is vulnerable to insecure direct object reference if the application lacks the<br />

proper authentication mechanism for target objects.<br />

● Solution<br />

Make sure that only authenticated users are allowed to access a particular object. In the context of <strong>SAP</strong> <strong>HANA</strong><br />

XS, use the "authentication" keyword to enable an authentication method and set it according to the<br />

authentication method you implement, for example: <strong>SAP</strong> logon ticket, form-based, or basic (user name and<br />

password) in the application's .xsaccess file, which ensures that all objects in the application path are<br />

available only to authenticated users.<br />

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

Writing Server-Side JavaScript Applications<br />

P U B L I C<br />

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

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

Saved successfully!

Ooh no, something went wrong!