Development resources, articles, tutorials, code samples, tools and downloads for SAP HANA and ABAP, HANA Database, SQLScript, SAP UI5, Screen Personas, Web Dynpro, Workflow
Security Checks for ABAP CVA - Read on sensitive database tables
When I execute ATC ABAP Test Cockpit Tool code checks for CVA (Code Vulnerability Analysis) results, I see following CVA entry:Security Checks for ABAP (CVA) Read on sensitive database tables.
And in the message detail, I see MARA, MVKE, MARC and MARD tables are accessed and listed as sensitive database tables with following messages:
Security Checks for ABAP (CVA)
Read on sensitive database tables
Read access (SELECT) to database table MARA
Read access (SELECT) to database table MVKE
Read access (SELECT) to database table MARC
Read access (SELECT) to database table MARD
When I clicked on one of the message it redirected me to following ABAP SELECT command.
I converted the above SELECT statement into a parametric CDS view object and added OData annotation "AccessControl.authorizationCheck" as "#CHECK" in the below format
Then I modified the original ABAP program source code as follows replacing the problematic ABAP SELECT command with below SELECT from parametric CDS View code
After the modification of OpenSQL in ABAP code into parametric CDS view, the Security Checks for ABAP (CVA) errors about Read on sensitive database tables dissappeared successfully.