Uploaded image for project: 'SonarTSQL'
  1. SonarTSQL
  2. SONARTSQL-271

S1523 should consider calls to sp_executesql

    XMLWordPrintable

    Details

    • Type: False Negative
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Rules
    • Labels:
      None

      Description

      The implementation of RSPEC-1523 (Dynamically executing code is security-sensitive) currently only checks the most simple EXECUTE statements.

      It should also check the first argument of each call to sp_executesql.

      Example:

      CREATE PROCEDURE PROC1(@PurchaseID VARCHAR(30)) AS
        BEGIN
          declare @sql nvarchar(max)
          select @sql = 'select Code, Messages from ShopItems where ShopItemID = '+@PurchaseID
          select @sql
          EXEC sp_executesql @sql -- False negative
        END
      GO
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              pierre-yves.nicolas Pierre-Yves Nicolas
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: