SonarSource Rules
  • Products

    In-IDE

    Code Quality and Security in your IDE with SonarQube Ide

    IDE extension that lets you fix coding issues before they exist!

    Discover SonarQube for IDE

    SaaS

    Code Quality and Security in the cloud with SonarQube Cloud

    Setup is effortless and analysis is automatic for most languages

    Discover SonarQube Cloud

    Self-Hosted

    Code Quality and Security Self-Hosted with SonarQube Server

    Fast, accurate analysis; enterprise scalability

    Discover SonarQube Server
  • SecretsSecrets
  • ABAPABAP
  • AnsibleAnsible
  • ApexApex
  • AzureResourceManagerAzureResourceManager
  • CC
  • C#C#
  • C++C++
  • CloudFormationCloudFormation
  • COBOLCOBOL
  • CSSCSS
  • DartDart
  • DockerDocker
  • FlexFlex
  • GitHub ActionsGitHub Actions
  • GoGo
  • HTMLHTML
  • JavaJava
  • JavaScriptJavaScript
  • JSONJSON
  • JCLJCL
  • KotlinKotlin
  • KubernetesKubernetes
  • Objective CObjective C
  • PHPPHP
  • PL/IPL/I
  • PL/SQLPL/SQL
  • PythonPython
  • RPGRPG
  • RubyRuby
  • RustRust
  • ScalaScala
  • ShellShell
  • SwiftSwift
  • TerraformTerraform
  • TextText
  • TypeScriptTypeScript
  • T-SQLT-SQL
  • VB.NETVB.NET
  • VB6VB6
  • XMLXML
  • YAMLYAML
ABAP

ABAP static code analysis

Unique rules to find Bugs, Vulnerabilities, Security Hotspots, and Code Smells in your ABAP code

  • All rules 94
  • Vulnerability4
  • Bug14
  • Security Hotspot7
  • Code Smell69
 
Tags
    Impact
      Clean code attribute
        1. Using weak hashing algorithms is security-sensitive

           Security Hotspot
        2. Using shell interpreter when executing OS commands is security-sensitive

           Security Hotspot
        3. Using "CALL TRANSACTION" statements without an authority check is security-sensitive

           Security Hotspot
        4. Hard-coded credentials are security-sensitive

           Security Hotspot
        5. Having dynamic clauses for SQL "SELECT" statements is security-sensitive

           Security Hotspot
        6. Having SQL "SELECT" statements without "WHERE" conditions is security-sensitive

           Security Hotspot
        7. Using hardcoded IP addresses is security-sensitive

           Security Hotspot

        Using "CALL TRANSACTION" statements without an authority check is security-sensitive

        intentionality - complete
        security
        Security Hotspot
        • cwe

        Using "CALL TRANSACTION" statements without an authority check is security sensitive. Its access should be restricted to specific users.

        This rule raises when a CALL TRANSACTION has no explicit authorization check, i.e. when:

        • the CALL TRANSACTION statement is not followed by WITH AUTHORITY-CHECK.
        • the CALL TRANSACTION statement is not following an AUTHORITY-CHECK statement.
        • the CALL TRANSACTION statement is not following a call to the AUTHORITY_CHECK_TCODE function.

        Ask Yourself Whether

        • the CALL TRANSACTION statement is restricted to the right users.

        There is a risk if you answered no to this question.

        Recommended Secure Coding Practices

        Check current user’s authorization before every CALL TRANSACTION statement. Since ABAP 7.4 this should be done by appending WITH AUTHORITY-CHECK to CALL TRANSACTION statements. In earlier versions the AUTHORITY-CHECK statement or a call to the AUTHORITY_CHECK_TCODE function can be used.

        Note that since ABAP 7.4 any CALL TRANSACTION statement not followed by WITH AUTHORITY-CHECK or WITHOUT AUTHORITY-CHECK is obsolete.

        Sensitive Code Example

        CALL TRANSACTION 'MY_DIALOG'.  " Sensitive as there is no apparent authorization check. It is also obsolete since ABAP 7.4.
        

        Compliant Solution

        AUTHORITY-CHECK OBJECT 'S_DIAGID'
                          ID 'ACTVT' FIELD '03'.
        IF sy-subrc <> 0.
          " show an error message...
        ENDIF.
        
        CALL TRANSACTION 'MY_DIALOG'. " Ok but obsolete since ABAP 7.4.
        

        or

        CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
          exporting
            tcode  = up_fdta
          exceptions
            ok     = 0
            others = 4.
        IF sy-subrc <> 0.
          " show an error message...
        ENDIF.
        
        CALL TRANSACTION up_fdta USING up_bdc mode 'E'. " Ok but obsolete since ABAP 7.4.
        

        or

        CALL TRANSACTION 'MY_DIALOG' WITH AUTHORITY-CHECK. " Recommended way since ABAP 7.4.
        

        Exceptions

        No issue will be raised when CALL TRANSACTION is followed by WITHOUT AUTHORITY-CHECK as it explicitly says that the TRANSACTION does not require an authorization check.

        See

        • OWASP - Top 10 2021 Category A1 - Broken Access Control
        • OWASP - Top 10 2017 Category A2 - Broken Authentication
        • CWE - CWE-285 - Improper Authorization
        • CWE - CWE-862 - Missing Authorization
          Available In:
        • SonarQube IdeCatch issues on the fly,
          in your IDE
        • SonarQube CloudDetect issues in your GitHub, Azure DevOps Services, Bitbucket Cloud, GitLab repositories
        • SonarQube ServerAnalyze code in your
          on-premise CI
          Developer Edition
          Available Since
          9.1

        © 2008-2025 SonarSource SA. All rights reserved.

        Privacy Policy | Cookie Policy | Terms of Use