Uploaded image for project: 'Rules Repository'
  1. Rules Repository
  2. RSPEC-4817

Executing XPath expressions is security-sensitive

    Details

    • Type: Security Hotspot Detection
    • Status: Active
    • Resolution: Unresolved
    • Labels:
    • Message:
      Make sure that executing this XPATH expression is safe.
    • Default Severity:
      Critical
    • Impact:
      High
    • Likelihood:
      Low
    • Default Quality Profiles:
      Sonar way
    • Targeted languages:
      APEX, C, C++, Go, Kotlin, Objective-C, Python, Ruby, Rust, Scala, Swift, TypeScript, VB6
    • Covered Languages:
      C#, Java, JavaScript, PHP, VB.Net
    • Irrelevant for Languages:
      CSS, HTML, PL/SQL, T-SQL, XML
    • Analysis Scope:
      Main Sources
    • Common Rule:
      Yes
    • CERT:
      IDS53-J.
    • CWE:
      CWE-643
    • OWASP:
      A1

      Description

      Executing XPATH expressions is security-sensitive. It has led in the past to the following vulnerabilities:

      User provided data such as URL parameters should always be considered as untrusted and tainted. Constructing XPath expressions directly from tainted data enables attackers to inject specially crafted values that changes the initial meaning of the expression itself. Successful XPath injections attacks can read sensitive information from the XML document.

      Ask Yourself Whether

      • the XPATH expression might contain some unsafe input coming from a user.

      You are at risk if you answered yes to this question.

      Recommended Secure Coding Practices

      Sanitize any user input before using it in an XPATH expression.

      See

        Attachments

          Issue Links

          1.
          Java RSPEC-4848 Language-Specification Deprecated Unassigned
          2.
          C# RSPEC-4876 Language-Specification Deprecated Unassigned
          3.
          VB.NET RSPEC-4976 Language-Specification Deprecated Unassigned
          4.
          JavaScript RSPEC-5080 Language-Specification Active Unassigned
          5.
          PHP RSPEC-5091 Language-Specification Active Unassigned
          6.
          Python RSPEC-5228 Language-Specification Active Unassigned

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                nicolas.harraudeau Nicolas Harraudeau
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: