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
  • SwiftSwift
  • TerraformTerraform
  • TextText
  • TypeScriptTypeScript
  • T-SQLT-SQL
  • VB.NETVB.NET
  • VB6VB6
  • XMLXML
  • YAMLYAML
C#

C# static code analysis

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

  • All rules 494
  • Vulnerability47
  • Bug88
  • Security Hotspot24
  • Code Smell335

  • Quick Fix 61
Filtered: 27 rules found
injection
    Impact
      Clean code attribute
        1. XSLT Transformations should not be vulnerable to injection attacks

           Vulnerability
        2. Server-side requests should not be vulnerable to traversing attacks

           Vulnerability
        3. Stack traces should not be disclosed

           Vulnerability
        4. Loop boundaries should not be vulnerable to injection attacks

           Vulnerability
        5. Connection strings should not be vulnerable to injections attacks

           Vulnerability
        6. Memory allocations should not be vulnerable to Denial of Service attacks

           Vulnerability
        7. Accessing files should not lead to filesystem oracle attacks

           Vulnerability
        8. Environment variables should not be defined from untrusted input

           Vulnerability
        9. XML operations should not be vulnerable to injection attacks

           Vulnerability
        10. Constructing arguments of system commands from user input is security-sensitive

           Security Hotspot
        11. Applications should not create session cookies from untrusted input

           Vulnerability
        12. Reflection should not be vulnerable to injection attacks

           Vulnerability
        13. Extracting archives should not lead to zip slip vulnerabilities

           Vulnerability
        14. OS commands should not be vulnerable to argument injection attacks

           Vulnerability
        15. Dynamic code execution should not be vulnerable to injection attacks

           Vulnerability
        16. NoSQL operations should not be vulnerable to injection attacks

           Vulnerability
        17. HTTP request redirections should not be open to forging attacks

           Vulnerability
        18. Logging should not be vulnerable to injection attacks

           Vulnerability
        19. Server-side requests should not be vulnerable to forging attacks

           Vulnerability
        20. Deserialization should not be vulnerable to injection attacks

           Vulnerability
        21. Endpoints should not be vulnerable to reflected cross-site scripting (XSS) attacks

           Vulnerability
        22. Database queries should not be vulnerable to injection attacks

           Vulnerability
        23. Regular expressions should not be vulnerable to Denial of Service attacks

           Vulnerability
        24. XPath expressions should not be vulnerable to injection attacks

           Vulnerability
        25. I/O function calls should not be vulnerable to path injection attacks

           Vulnerability
        26. LDAP queries should not be vulnerable to injection attacks

           Vulnerability
        27. OS commands should not be vulnerable to command injection attacks

           Vulnerability

        XSLT Transformations should not be vulnerable to injection attacks

        intentionality - complete
        security
        Vulnerability
        • injection

        Why is this an issue?

        How can I fix it?

        More Info

        XSLT Injection is a security vulnerability that occurs when an application uses untrusted user input to construct an XSLT (Extensible Stylesheet Language Transformations) stylesheet. XSLT engines are powerful templating tools designed to transform XML documents

        What is the potential impact?

        An attacker can provide malicious XSLT code that the application’s XML processor will then execute, such as references to other files, embedded scripts, or special objects.

        Below are some real-world scenarios that illustrate some impacts of an attacker exploiting the vulnerability.

        Reading Sensitive Files

        The most common impact of XSLT Injection is the ability to read files from the server’s file system. XSLT has built-in functions that can access local or remote XML files. An attacker can use this function to read sensitive information.

        Attacking Other Systems

        Attackers can use XSLT Injection to force the server to make network requests to other systems on the internal network that are not accessible from the internet.

        This could allow an attacker to: * Scan the internal network for open ports and active services. * Access internal, unprotected administrative panels. * Interact with cloud provider metadata services to steal access credentials.

        Denial of Service

        A malicious stylesheet can also be designed to consume a large amount of server resources, such as memory or CPU time. This can cause the application to slow down or crash, making it unavailable for legitimate users.
        An attacker could create a recursive stylesheet that never finishes, causing the processor to enter an infinite loop and exhaust all available CPU resources.

          Available In:
        • SonarQube CloudDetect issues in your GitHub, Azure DevOps Services, Bitbucket Cloud, GitLab repositories
        • SonarQube ServerAnalyze code in your
          on-premise CI

        © 2008-2025 SonarSource SA. All rights reserved.

        Privacy Policy | Cookie Policy | Terms of Use