Sample: PowerShell — see SquidGate detect findings - #18
Conversation
Demo only — hardcoded secret + injection / dangerous API patterns. See examples/README.md
🛡️ Security Scan ResultsThe changes introduce a new demo script containing a hardcoded credential, SQL injection via string concatenation, and use of the dangerous Invoke-Expression function. ⛔ 3 finding(s) block merge. HIGH — Hardcoded API KeyFile: An API key is hardcoded directly in the source code as $ApiKey, exposing credentials if the script is shared, logged, or committed to version control. CWE: CWE-798 | OWASP: A07:2021 Recommendation: Remove the hardcoded value and retrieve the API key from environment variables or a secure secrets manager (e.g., $ApiKey = $env:API_KEY). HIGH — SQL InjectionFile: User input from $Id is directly concatenated into the SQL query string without parameterization or escaping, enabling SQL injection attacks via Invoke-Sqlcmd. CWE: CWE-89 | OWASP: A03:2021 Recommendation: Use parameterized queries: Invoke-Sqlcmd -Query 'SELECT * FROM users WHERE id = @id' -Variable @{Id=$Id} HIGH — Dangerous Use of Invoke-ExpressionFile: Invoke-Expression is called directly on untrusted user input $Code, allowing arbitrary code execution and remote code execution if input is attacker-controlled. CWE: CWE-95 | OWASP: A03:2021 Recommendation: Avoid Invoke-Expression with untrusted data. Use direct function calls, approved cmdlets, or strict input validation and whitelisting. |
SquidGate language sample — PowerShell
This PR intentionally introduces insecure patterns so you can see SquidGate work on PowerShell:
File
examples/powershell/Demo.ps1What to look for
block_on(defaulthigh)All language samples · Setup SquidGate on your repo