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
XML

XML static code analysis

Unique rules to find Bugs and Code Smells in your XML code

  • All rules 37
  • Vulnerability7
  • Bug5
  • Security Hotspot9
  • Code Smell16
Filtered: 15 rules found
cwe
    Impact
      Clean code attribute
        1. Components should be explicitly exported

           Vulnerability
        2. Defining a single permission for read and write access of content providers is security-sensitive

           Security Hotspot
        3. Custom permissions should not be defined in the "android.permission" namespace

           Vulnerability
        4. Allowing application backups is security-sensitive

           Security Hotspot
        5. Requesting dangerous Android permissions is security-sensitive

           Security Hotspot
        6. Exported component access should be restricted with appropriate permissions

           Vulnerability
        7. Using clear-text protocols is security-sensitive

           Security Hotspot
        8. Receiving intents is security-sensitive

           Security Hotspot
        9. Having a permissive Cross-Origin Resource Sharing policy is security-sensitive

           Security Hotspot
        10. Delivering code in production with debug features activated is security-sensitive

           Security Hotspot
        11. Struts validation forms should have unique names

           Vulnerability
        12. Creating cookies without the "HttpOnly" flag is security-sensitive

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

           Security Hotspot
        14. Track uses of "TODO" tags

           Code Smell
        15. Track uses of "FIXME" tags

           Code Smell

        Allowing application backups is security-sensitive

        intentionality - complete
        security
        Security Hotspot
        • cwe
        • android

        Android has a built-in backup mechanism that can save and restore application data. When application backup is enabled, local data from your application can be exported to Google Cloud or to an external device via adb backup. Enabling Android backup exposes your application to disclosure of sensitive data. It can also lead to corruption of local data when restoration is performed from an untrusted source.

        By default application backup is enabled and it includes:

        • Shared preferences files
        • Files saved in one of the paths returned by
          • getDatabasePath(String)
          • getFilesDir()
          • getDir(String, int)
          • getExternalFilesDir(String)

        Ask Yourself Whether

        • Application backup is enabled and sensitive data is stored in local files, local databases, or shared preferences.
        • Your application never validates data from files that are included in backups.

        There is a risk if you answered yes to any of those questions.

        Recommended Secure Coding Practices

        • Disable application backup unless it is required for your application to work properly.
        • Narrow the scope of backed-up files by using either
          • backup rules (see android:fullBackupContent attribute).
          • a custom BackupAgent.
          • the dedicated no_backup folder (see android.content.Context#getNoBackupFilesDir()).
        • Do not back up local data containing sensitive information unless they are properly encrypted.
        • Make sure that the keys used to encrypt backup data are not included in the backup.
        • Validate data from backed-up files. They should be considered untrusted as they could have been restored from an untrusted source.

        Sensitive Code Example

        <application
            android:allowBackup="true"> <!-- Sensitive -->
        </application>
        

        Compliant Solution

        Disable application backup.

        <application
            android:allowBackup="false">
        </application>
        

        If targeting Android 6.0 or above (API level 23), define files to include/exclude from the application backup.

        <application
            android:allowBackup="true"
            android:fullBackupContent="@xml/backup.xml">
        </application>
        

        See

        • OWASP - Top 10 2017 Category A3 - Sensitive Data Exposure
        • OWASP - Top 10 2017 Category A6 - Security Misconfiguration
        • OWASP - Top 10 2021 Category A1 - Broken Access Control
        • OWASP - Mobile AppSec Verification Standard - Data Storage and Privacy Requirements
        • OWASP - Mobile Top 10 2016 Category M1 - Improper platform usage
        • OWASP - Mobile Top 10 2016 Category M2 - Insecure Data Storage
        • OWASP - Mobile Top 10 2024 Category M9 - Insecure Data Storage
        • CWE - CWE-922 - Insecure Storage of Sensitive Information
        • Back up user data with Auto Backup
          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 Community BuildAnalyze code in your
          on-premise CI
          Available Since
          9.2
        • SonarQube ServerAnalyze code in your
          on-premise CI
          Developer Edition
          Available Since
          9.2

        © 2008-2025 SonarSource SA. All rights reserved.

        Privacy Policy | Cookie Policy | Terms of Use