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
Java

Java static code analysis

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

  • All rules 733
  • Vulnerability60
  • Bug175
  • Security Hotspot40
  • Code Smell458

  • Quick Fix 65
Filtered: 23 rules found
symbolic-execution
    Impact
      Clean code attribute
        1. XML signatures should be validated securely

           Vulnerability
        2. XML parsers should not be vulnerable to Denial of Service attacks

           Vulnerability
        3. XML parsers should not load external schemas

           Vulnerability
        4. XML parsers should not allow inclusion of arbitrary files

           Vulnerability
        5. Nullness of parameters should be guaranteed

           Code Smell
        6. Assignments should not be redundant

           Code Smell
        7. Consumed Stream pipelines should not be reused

           Bug
        8. Intermediate Stream methods should not be left unused

           Bug
        9. "Map.get" and value test should be replaced with single method call

           Code Smell
        10. Optional value should only be accessed after calling isPresent()

           Bug
        11. Custom resources should be closed

           Bug
        12. Zero should not be a possible denominator

           Bug
        13. Methods returns should not be invariant

           Code Smell
        14. Min and max used in combination should not always return the same value

           Bug
        15. XML parsers should not be vulnerable to XXE attacks

           Vulnerability
        16. Files opened in append mode should not be used with "ObjectOutputStream"

           Bug
        17. "@NonNull" values should not be set to null

           Bug
        18. Boolean expressions should not be gratuitous

           Code Smell
        19. Conditionally executed code should be reachable

           Bug
        20. Null pointers should not be dereferenced

           Bug
        21. Locks should be released on all paths

           Bug
        22. Loops should not be infinite

           Bug
        23. Resources should be closed

           Bug

        XML parsers should not allow inclusion of arbitrary files

        consistency - conventional
        security
        Vulnerability
        • symbolic-execution

        XML standard allows the inclusion of XML files with the xinclude element. When an XML parser component is set up with the http://apache.org/xml/features/xinclude feature, it will follow the standard and allow the inclusion of remote files.

        Why is this an issue?

        How can I fix it?

        More Info

        When the XML parser will encounter an xinclude element, it will try to load the file pointed to by the href attribute into the document. Included files can either be local files found on the file system of the application server, or remote files that are downloaded over HTTP, SMB, or other protocols, depending on the capabilities of the application and server.

        The files that can be accessed that way are only limited by the entitlement of the application on the local system and the network filtering the server is subject to.

        This issue is particularly severe when the XML parser is used to parse untrusted documents. For example, when user-submitted XML messages are parsed that way.

        What is the potential impact?

        Allowing the inclusion of arbitrary files in XML documents can have two main consequences depending on what type of file is included: local or remote.

        Sensitive file disclosure

        If the application allows the inclusion of arbitrary files through the use of the xinclude element, it might be used to disclose arbitrary files from the local file system. Depending on the application’s permissions on the file system, configuration files, runtime secrets, or Personally Identifiable Information could be leaked.

        This is particularly true if the affected parser is used to process untrusted XML documents.

        Server-side request forgery

        When used to retrieve remote files, the application will send network requests to remote hosts. Moreover, it will do so from its current network location, which can have severe consequences if the application server is located on a sensitive network, such as the company corporate network or a DMZ hosting other applications.

        Attackers exploiting this issue could try to access internal backend services or corporate file shares. It could allow them to access more sensitive files, bypass authentication mechanisms from frontend applications, or exploit further vulnerabilities in the local services. Note that, in some cases, the requests sent from the application can be automatically authenticated on federated locations. This is often the case in Windows environments when using Active Directory federated authentication.

          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.4
        • SonarQube ServerAnalyze code in your
          on-premise CI
          Developer Edition
          Available Since
          9.4

        © 2008-2025 SonarSource SA. All rights reserved.

        Privacy Policy | Cookie Policy | Terms of Use