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
PHP

PHP static code analysis

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

  • All rules 263
  • Vulnerability55
  • Bug51
  • Security Hotspot11
  • Code Smell146
 
Tags
    Impact
      Clean code attribute
        1. Server-side requests should not be vulnerable to traversing attacks

           Vulnerability
        2. Credentials should not be hard-coded

           Vulnerability
        3. Secrets should not be hard-coded

           Vulnerability
        4. Untrusted user input should not be used in file operations

           Vulnerability
        5. Prevent unfiltered HTML exposure in WordPress for enhanced security

           Vulnerability
        6. Prevent unauthenticated WordPress database repair for enhanced security

           Vulnerability
        7. External requests should be restricted in WordPress to prevent data leaks and SSRF

           Vulnerability
        8. Automatic updates should not be disabled

           Vulnerability
        9. Disable direct file editing in WordPress admin interface

           Vulnerability
        10. Secret keys and salt values should be robust

           Vulnerability
        11. Applications should not create session cookies from untrusted input

           Vulnerability
        12. Reflection should not be vulnerable to injection attacks

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

           Vulnerability
        14. A new session should be created during user authentication

           Vulnerability
        15. Authorizations should be based on strong decisions

           Vulnerability
        16. Cipher algorithms should be robust

           Vulnerability
        17. Encryption algorithms should be used with secure mode and padding scheme

           Vulnerability
        18. Server hostnames should be verified during SSL/TLS connections

           Vulnerability
        19. Include expressions should not be vulnerable to injection attacks

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

           Vulnerability
        21. Session IDs must be securely generated and not user-specified

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

           Vulnerability
        23. Logging should not be vulnerable to injection attacks

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

           Vulnerability
        25. Deserialization should not be vulnerable to injection attacks

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

           Vulnerability
        27. Avoid overly permissive Cross-Origin Resource Sharing (CORS) policies to enhance security

           Vulnerability
        28. Server certificates should be verified during SSL/TLS connections

           Vulnerability
        29. Deactivate debugging features before deploying to production

           Vulnerability
        30. LDAP connections should be authenticated

           Vulnerability
        31. Cryptographic keys should be robust

           Vulnerability
        32. Weak SSL/TLS protocols should not be used

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

           Vulnerability
        34. "file_uploads" should be disabled

           Vulnerability
        35. "enable_dl" should be disabled

           Vulnerability
        36. "session.use_trans_sid" should not be enabled

           Vulnerability
        37. "cgi.force_redirect" should be enabled

           Vulnerability
        38. "allow_url_fopen" and "allow_url_include" should be disabled

           Vulnerability
        39. "open_basedir" should limit file access

           Vulnerability
        40. Session-management cookies should not be persistent

           Vulnerability
        41. "sleep" should not be called

           Vulnerability
        42. XML parsers should not be vulnerable to XXE attacks

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

           Vulnerability
        44. Avoid overly permissive POSIX file permissions to enhance security

           Vulnerability
        45. Neither DES (Data Encryption Standard) nor DESede (3DES) should be used

           Vulnerability
        46. Cryptographic RSA algorithms should always incorporate OAEP (Optimal Asymmetric Encryption Padding)

           Vulnerability
        47. A secure password should be used when connecting to a database

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

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

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

           Vulnerability
        51. Use prepared statements to securely construct SQL queries

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

           Vulnerability
        53. SHA-1 and Message-Digest hash algorithms should not be used in secure contexts

           Vulnerability
        54. Credentials should not be hard-coded

           Vulnerability
        55. Password hashing functions should use an unpredictable salt

           Vulnerability

        Untrusted user input should not be used in file operations

        intentionality - logical
        security
        Vulnerability
        • cwe
        • injection

        Why is this an issue?

        How can I fix it?

        More Info

        Using untrusted input as arguments for system commands can lead to command injection vulnerabilities, allowing attackers to execute arbitrary commands on the server. This can compromise the security and integrity of the system, leading to data breaches, unauthorized access, and other malicious activities.

          Available In:
        • 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.2

        © 2025 SonarSource Sàrl. All rights reserved.

        Privacy Policy | Cookie Policy | Terms of Use