Sample: Perl — see SquidGate detect findings - #20
Conversation
Demo only — hardcoded secret + injection / dangerous API patterns. See examples/README.md
🛡️ Security Scan ResultsThe new demo.pl file introduces hardcoded credentials, SQL injection, and command injection vulnerabilities. ⛔ 3 finding(s) block merge. HIGH — Hardcoded API KeyFile: A secret API key is hardcoded directly in the source code. This exposes the credential if the file is committed to version control or distributed. CWE: CWE-798 | OWASP: A07:2021 Recommendation: Remove the hardcoded key and load it from environment variables or a secure secrets manager. Example: my $API_KEY = $ENV{'API_KEY'}; HIGH — SQL Injection VulnerabilityFile: User-controlled input ($id) is directly interpolated into a SQL query string without parameterization or escaping, enabling SQL injection attacks. CWE: CWE-89 | OWASP: A03:2021 Recommendation: Use parameterized queries or prepared statements with DBI. Example: $sth = $dbh->prepare('SELECT * FROM users WHERE id = ?'); $sth->execute($id); HIGH — OS Command InjectionFile: User input ($name) is passed unsanitized to system(), allowing arbitrary command execution via shell metacharacters. CWE: CWE-78 | OWASP: A03:2021 Recommendation: Avoid system() with user input. Use safe APIs or escape arguments properly. Example: use IPC::Run or list form: system('echo', $name); |
SquidGate language sample — Perl
This PR intentionally introduces insecure patterns so you can see SquidGate work on Perl:
File
examples/perl/demo.plWhat to look for
block_on(defaulthigh)All language samples · Setup SquidGate on your repo