SAP USER DEPENDENT SCRTY
Get Example source ABAP code based on a different SAP table
User-Dependent Program Flow
The use of user names in ABAP programs to control program behavior can be a security risk. In the worst case scenario, a back door can be created and used by developers to access unauthorized data or functions in systems where they do not have authorization. On the other hand, these can also be code sections used for test purposes during development and then forgotten. Generally speaking, user-dependent source code should always be avoided and removed if necessary. In cases where user-dependent source code is absolutely necessary, a special exemption must be granted for the program so that it can pass the appropriate security tests.
In ABAP, user-dependent program flows can occur in the following instances:
User names passed to the program from the outside should never be used. If this does become necessary, however, the names must be checked carefully.
Latest notes:
ABAP_HINT_END
Example ABAP Coding
The following program section demonstrates a back door where an authorization check for a user is ignored intentionally. The program must be repaired by removing the
ID 'DEVCLASS' FIELD '...'
ID 'OBJTYPE' DUMMY
ID 'OBJNAME' DUMMY
ID 'P_GROUP' DUMMY
ID 'ACTVT' FIELD '02'.
IF sy-subrc <> 0.
IF sy-uname <> '...'.
LEAVE PROGRAM.
ENDIF.
ENDIF.>
ABAP_EXAMPLE_END