Security Researcher Builds SAST Scanner for AI-Generated Code and Audits 3,800 Public Repositories

A developer released AigisSAST, a lightweight open-source static analysis tool written in pure Python with no external dependencies, specifically tuned to detect common mistakes made by AI coding assistants. The scanner was run across roughly 3,800 repositories ranging from small pet projects to popular open-source platforms. It identified thousands of potential secrets and misconfigurations, yet manual review reduced the number of genuine leaks to approximately 30 cases, mostly Telegram bot tokens, database credentials, and committed .env files. The project also examined 471 production-grade Telegram bots handling payments and VPN services, uncovering 31 repositories that exposed real credentials either in current code or in Git history. AigisSAST includes 21 detection rules, 193 regression tests, automatic remediation via the fix command, and seamless integration with GitHub Actions. The author deliberately avoided validating any discovered keys to stay within ethical research boundaries.

HabrTranslated from Russian

Read at source

A developer has published AigisSAST, a console-based static application security testing tool designed specifically for code produced by AI assistants such as Cursor. The scanner, written in approximately 3,000 lines of pure Python without any external dependencies, parses code using AST rather than simple pattern matching to reduce false positives on strings that resemble secrets.

The researcher ran the tool against roughly 3,800 public repositories. The first round targeted 126 projects explicitly marked as AI-generated through files such as .cursorrules or CLAUDE.md. Subsequent rounds examined 49 large open-source platforms, 2,292 smaller projects including Telegram bots and VPN panels, 471 production bots handling real payments via Stars, CryptoBot and YooKassa, and finally 879 additional repositories scanned blindly.

Key findings included 16,378 high or critical alerts in the initial pass on the 471 live bots; after manual triage only about 30 proved to be genuine exposures. These comprised Telegram bot tokens, OpenAI and Google service-account keys, MongoDB and TiDB connection strings with embedded passwords, and full .env files containing Marzban and 3x-ui credentials. Ten secrets were present in the current working tree while 22 existed only in Git history.

The scanner implements 21 rules covering hardcoded tokens for Telegram, GitHub, AWS and Stripe, SQL and command injection via f-strings, unsafe use of pickle and eval, missing JWT signature verification, overly permissive CORS, debug mode left enabled, and database ports exposed on 0.0.0.0. Each finding is accompanied by a human-readable explanation, risk description and suggested remediation, with secrets automatically masked before display.

AigisSAST also offers an automatic fix mode that moves secrets into .env files, updates .gitignore, replaces random token generation with the secrets module, disables debug flags, and hardens Docker and YAML configurations. SQL injection and JWT issues are left untouched because safe fixes require application-specific logic.

The author stresses that the project deliberately avoids any active validation of discovered credentials. No tokens were tested against live services, and the scanner only reads publicly available code. The complete source code is released under the MIT license on GitHub, and the developer invites community feedback through issues and pull requests to further reduce false positives.

Meridian digestThe week's most consequential security stories, distilled into one briefing.See the digest

More in Supply Chain & Open Source

Passwordless Kubernetes Image Pulling with Artifact Keeper via ServiceAccount Tokens
Malicious Code Injected into LiteLLM Open Source AI Package via Supply Chain Attack
GhostAction Campaign Compromises 790 GitHub Repositories via Malicious Workflows