From 4a9f35f0a8686424110e19e187a07fc2c39c6cf8 Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Thu, 10 Jun 2021 17:59:24 -0400 Subject: [PATCH] Update ReportOutputTest.php --- tests/ReportOutputTest.php | 187 +++++++++++++++++++++++++++++++++++++ 1 file changed, 187 insertions(+) diff --git a/tests/ReportOutputTest.php b/tests/ReportOutputTest.php index 20381be0d..157023a74 100644 --- a/tests/ReportOutputTest.php +++ b/tests/ReportOutputTest.php @@ -136,6 +136,23 @@ echo "Successfully executed the command: " . $prefixedData;'; 'text' => file_get_contents(__DIR__ . '/../docs/running_psalm/issues/TaintedHtml.md'), ], ], + [ + 'id' => '274', + 'name' => 'TaintedTextWithQuotes', + 'shortDescription' => [ + 'text' => 'TaintedTextWithQuotes' + ], + 'properties' => [ + 'tags' => [ + 'security' + ], + ], + 'helpUri' => 'https://psalm.dev/274', + 'help' => [ + 'markdown' => file_get_contents(__DIR__ . '/../docs/running_psalm/issues/TaintedTextWithQuotes.md'), + 'text' => file_get_contents(__DIR__ . '/../docs/running_psalm/issues/TaintedTextWithQuotes.md'), + ], + ], ] ] ], @@ -464,6 +481,176 @@ echo "Successfully executed the command: " . $prefixedData;'; ] ] ] + ], + [ + 'ruleId' => '274', + 'message' => [ + 'text' => 'Detected tainted text with possible quotes' + ], + 'level' => 'error', + 'locations' => [ + [ + 'physicalLocation' => [ + 'artifactLocation' => [ + 'uri' => 'taintflow-test/vulnerable.php' + ], + 'region' => [ + 'startLine' => 11, + 'endLine' => 11, + 'startColumn' => 6, + 'endColumn' => 59 + ] + ] + ] + ], + 'codeFlows' => [ + [ + 'message' => [ + 'text' => 'Tracing the path from user input to insecure usage' + ], + 'threadFlows' => [ + [ + 'locations' => [ + [ + 'location' => [ + 'physicalLocation' => [ + 'artifactLocation' => [ + 'uri' => 'taintflow-test/vulnerable.php' + ], + 'region' => [ + 'startLine' => 7, + 'endLine' => 7, + 'startColumn' => 46, + 'endColumn' => 52 + ] + ] + ] + ], + [ + 'location' => [ + 'physicalLocation' => [ + 'artifactLocation' => [ + 'uri' => 'taintflow-test/vulnerable.php' + ], + 'region' => [ + 'startLine' => 7, + 'endLine' => 7, + 'startColumn' => 46, + 'endColumn' => 59 + ] + ] + ] + ], + [ + 'location' => [ + 'physicalLocation' => [ + 'artifactLocation' => [ + 'uri' => 'taintflow-test/vulnerable.php' + ], + 'region' => [ + 'startLine' => 3, + 'endLine' => 3, + 'startColumn' => 36, + 'endColumn' => 42 + ] + ] + ] + ], + [ + 'location' => [ + 'physicalLocation' => [ + 'artifactLocation' => [ + 'uri' => 'taintflow-test/vulnerable.php' + ], + 'region' => [ + 'startLine' => 3, + 'endLine' => 3, + 'startColumn' => 36, + 'endColumn' => 42 + ] + ] + ] + ], + [ + 'location' => [ + 'physicalLocation' => [ + 'artifactLocation' => [ + 'uri' => 'taintflow-test/vulnerable.php' + ], + 'region' => [ + 'startLine' => 4, + 'endLine' => 4, + 'startColumn' => 12, + 'endColumn' => 28 + ] + ] + ] + ], + [ + 'location' => [ + 'physicalLocation' => [ + 'artifactLocation' => [ + 'uri' => 'taintflow-test/vulnerable.php' + ], + 'region' => [ + 'startLine' => 3, + 'endLine' => 3, + 'startColumn' => 45, + 'endColumn' => 51 + ] + ] + ] + ], + [ + 'location' => [ + 'physicalLocation' => [ + 'artifactLocation' => [ + 'uri' => 'taintflow-test/vulnerable.php' + ], + 'region' => [ + 'startLine' => 7, + 'endLine' => 7, + 'startColumn' => 1, + 'endColumn' => 14 + ] + ] + ] + ], + [ + 'location' => [ + 'physicalLocation' => [ + 'artifactLocation' => [ + 'uri' => 'taintflow-test/vulnerable.php' + ], + 'region' => [ + 'startLine' => 11, + 'endLine' => 11, + 'startColumn' => 6, + 'endColumn' => 59 + ] + ] + ] + ], + [ + 'location' => [ + 'physicalLocation' => [ + 'artifactLocation' => [ + 'uri' => 'taintflow-test/vulnerable.php' + ], + 'region' => [ + 'startLine' => 11, + 'endLine' => 11, + 'startColumn' => 6, + 'endColumn' => 59 + ] + ] + ] + ] + ] + ] + ] + ] + ] ] ] ]