Skip to content
C

CodeGuardian

Scan, trace, and patch vulnerabilities automatic

Created on 8th March 2026

•

C

CodeGuardian

Scan, trace, and patch vulnerabilities automatic

The problem CodeGuardian solves

Modern software projects often contain hidden security vulnerabilities such as SQL injections, hardcoded secrets, insecure API usage, and command injection, which are usually introduced unintentionally during development and can remain unnoticed until they lead to serious security breaches. While existing security tools can detect these vulnerabilities, they typically only show what is vulnerable without explaining when or where the issue was introduced, forcing developers to manually investigate the origin of the problem and implement fixes themselves through time-consuming code changes and pull requests. This slows development workflows and increases security risks. CodeGuardian addresses this challenge by combining automated vulnerability detection, Git-based forensic analysis, and automated patch generation into a single workflow. It scans GitHub repositories for security issues, identifies the exact commit and author responsible for introducing the vulnerable code using Git history analysis, visualizes how vulnerabilities evolve over time through a security timeline, and automatically generates secure patches that can be applied through a pull request with minimal developer intervention. By automating detection, investigation, and remediation, CodeGuardian helps development teams identify security issues earlier, trace vulnerabilities back to their origin, fix them faster, and maintain more secure and reliable codebases with significantly less manual effort.

Challenges we ran into

One of the biggest challenges while building CodeGuardian was correctly linking detected vulnerabilities to the exact commit that introduced them. While Semgrep could identify vulnerable code and provide the file and line number, mapping that information back to the responsible commit required reliable integration with Git history. Initially, the system struggled to correctly extract commit metadata and sometimes returned incorrect or empty results when running git blame on dynamically cloned repositories. Another challenge was ensuring that automatic patches were actually applied to the correct lines in the source code, since matching code snippets directly often failed due to formatting differences. This was resolved by modifying the patching logic to apply fixes based on line numbers rather than string matching. Additionally, integrating Semgrep with the Node.js backend caused encoding issues on Windows systems due to Python’s default character encoding, which prevented scan results from being parsed correctly. Overcoming these issues required careful debugging of Git commands, improving the patch generation logic, and stabilizing the backend scanning workflow to ensure vulnerabilities could be detected, traced, patched, and converted into pull requests reliably.

Discussion

Builders also viewed

See more projects on Devfolio