Student builds AST-based GitHub Action to flag Java SQL injection and hardcoded secrets
A George Mason sophomore built a GitHub Action that scans Java code for SQL injection and hardcoded secrets, marking the affected lines on pull requests. Instead of plain text search, the tool uses JavaParser to convert files into abstract syntax trees, letting rules detect queries built by concatenating user input rather than using PreparedStatement. To reduce false alarms, the author tested the scanner on 31 open source projects and manually reviewed the results, cutting secret false positives from 156 to 27 while still catching every real secret. An optional step uses a local Ollama model to suggest fixes, which are re-parsed to confirm they are valid Java before being shown. The project includes 57 JUnit tests and can be set up in about two minutes via a workflow file, and the author positions it as a learning project for student and small projects rather than a replacement for tools like CodeQL or Semgrep.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in