Is there an existing issue for this?
What happened?
📌 Context & Executive Summary
As part of an initiative to improve the security posture and code maintainability of Devr.AI, I ran a comprehensive Static Application Security Testing (SAST) scan on the codebase using Code Guardian.
The scan analyzed 243 files (20,770 lines) and identified several high-priority security vulnerabilities, reliability concerns, and areas with high cognitive complexity. I have manually reviewed the automated findings to filter out false positives and categorize the legitimate issues below.
🔒 1. Security: Potential Hardcoded Secrets (API Keys)
Severity: High | Confidence: Medium (60%)
Description:
The scanner detected Heroku API keys within the database population scripts. While these are highly likely to be "dummy" or mock keys used for local testing, hardcoded secrets (even fake ones) trigger automated security alerts and create alert fatigue. If these are active keys, this is a critical security risk.
Locations:
backend/app/database/supabase/scripts/populate_db.sql (Lines: 13, 23, 33)
Recommended Fix:
- Replace the hardcoded strings with obvious placeholder text (e.g.,
<YOUR_MOCK_HEROKU_KEY>) or migrate these values to an .env.example file so they can be loaded via environment variables during local setup.
⚡ 2. Security: Dynamic Code Execution Risks
Severity: High | Confidence: High (80%)
Description:
The scan flagged several instances where dynamic code is being executed (likely via eval(), exec(), or unsafe innerHTML injections). If any of these execution paths process unsanitized user or third-party input, it exposes the application to Cross-Site Scripting (XSS) or Arbitrary Code Execution vulnerabilities.
Locations:
backend/app/database/falkor/code-graph-backend/static/index.html (Lines: 79, 108, 113)
backend/app/database/falkor/code-graph-backend/tests/test_c_analyzer.py (Lines: 38, 46)
backend/app/database/falkor/code-graph-backend/tests/test_graph_ops.py (Line: 15)
Recommended Fix:
- Review the flagged lines to ensure no user-controlled data is passed to dynamic execution functions. Replace
eval() with safer alternatives like JSON.parse() (if parsing data) or use safe DOM manipulation APIs.
🐛 3. Reliability: Unhandled Promises (Silent Failures)
Severity: High | Confidence: Very High (90%)
Description:
Asynchronous Promises are being executed without proper error handling. If the underlying API request or operation fails, the application will fail silently. This leads to a degraded user experience where the UI does not reflect the error state, making debugging incredibly difficult.
Locations:
backend/app/database/falkor/code-graph-backend/static/index.html (Lines: 117, 130)
Recommended Fix:
- Wrap the asynchronous logic in
try/catch blocks (if using async/await) or append .catch(err => ...) chains to handle and properly log the UI errors.
🧹 4. Code Quality: High Cognitive Complexity & Tech Debt
Severity: Medium | Impact: Developer Experience / Maintainability
Description:
Several core React components and backend Python scripts have grown too long and possess high cognitive complexity. In an open-source environment, highly complex files create friction for new contributors trying to understand the codebase.
Locations:
Frontend:
frontend/src/components/pages/LoginPage.tsx (Line 50)
frontend/src/components/pages/ResetPasswordPage.tsx (Line 49)
frontend/src/components/pages/SettingsPage.tsx (Line 12)
frontend/src/components/pages/SignUpPage.tsx (Line 51)
frontend/src/components/pages/SupportPage.tsx (Line 54)
Backend:
backend/app/database/falkor/code-graph-backend/api/prompts.py (Line 24)
Recommended Fix:
- Refactor these large pages by abstracting reusable logic into Custom React Hooks (
useAuth, etc.) and breaking down the UI into smaller, modular components.
🚫 False Positives Identified (No Action Required)
During my manual review of the scan, the tool flagged multiple GitHub Issue Templates (.github/ISSUE_TEMPLATE/*.yml) for "Use of 'any' type reduces type safety".
This is a scanner bug caused by a TypeScript linting rule being incorrectly applied to plain English text inside YAML files. I have filtered these out, and the .github directory requires no changes.
✅ Proposed Action Plan (Checklist)
I would love to help resolve these issues to improve the project! If the maintainers agree with these findings, we can break this down into the following PRs:
@maintainers: Please let me know which of these you consider the highest priority, and I would be happy to be assigned to work on it! 🚀
Record
Is there an existing issue for this?
What happened?
📌 Context & Executive Summary
As part of an initiative to improve the security posture and code maintainability of
Devr.AI, I ran a comprehensive Static Application Security Testing (SAST) scan on the codebase using Code Guardian.The scan analyzed 243 files (20,770 lines) and identified several high-priority security vulnerabilities, reliability concerns, and areas with high cognitive complexity. I have manually reviewed the automated findings to filter out false positives and categorize the legitimate issues below.
🔒 1. Security: Potential Hardcoded Secrets (API Keys)
Severity:
High| Confidence:Medium (60%)Description:
The scanner detected Heroku API keys within the database population scripts. While these are highly likely to be "dummy" or mock keys used for local testing, hardcoded secrets (even fake ones) trigger automated security alerts and create alert fatigue. If these are active keys, this is a critical security risk.
Locations:
backend/app/database/supabase/scripts/populate_db.sql(Lines: 13, 23, 33)Recommended Fix:
<YOUR_MOCK_HEROKU_KEY>) or migrate these values to an.env.examplefile so they can be loaded via environment variables during local setup.⚡ 2. Security: Dynamic Code Execution Risks
Severity:
High| Confidence:High (80%)Description:
The scan flagged several instances where dynamic code is being executed (likely via
eval(),exec(), or unsafe innerHTML injections). If any of these execution paths process unsanitized user or third-party input, it exposes the application to Cross-Site Scripting (XSS) or Arbitrary Code Execution vulnerabilities.Locations:
backend/app/database/falkor/code-graph-backend/static/index.html(Lines: 79, 108, 113)backend/app/database/falkor/code-graph-backend/tests/test_c_analyzer.py(Lines: 38, 46)backend/app/database/falkor/code-graph-backend/tests/test_graph_ops.py(Line: 15)Recommended Fix:
eval()with safer alternatives likeJSON.parse()(if parsing data) or use safe DOM manipulation APIs.🐛 3. Reliability: Unhandled Promises (Silent Failures)
Severity:
High| Confidence:Very High (90%)Description:
Asynchronous Promises are being executed without proper error handling. If the underlying API request or operation fails, the application will fail silently. This leads to a degraded user experience where the UI does not reflect the error state, making debugging incredibly difficult.
Locations:
backend/app/database/falkor/code-graph-backend/static/index.html(Lines: 117, 130)Recommended Fix:
try/catchblocks (if usingasync/await) or append.catch(err => ...)chains to handle and properly log the UI errors.🧹 4. Code Quality: High Cognitive Complexity & Tech Debt
Severity:
Medium| Impact:Developer Experience / MaintainabilityDescription:
Several core React components and backend Python scripts have grown too long and possess high cognitive complexity. In an open-source environment, highly complex files create friction for new contributors trying to understand the codebase.
Locations:
Frontend:
frontend/src/components/pages/LoginPage.tsx(Line 50)frontend/src/components/pages/ResetPasswordPage.tsx(Line 49)frontend/src/components/pages/SettingsPage.tsx(Line 12)frontend/src/components/pages/SignUpPage.tsx(Line 51)frontend/src/components/pages/SupportPage.tsx(Line 54)Backend:
backend/app/database/falkor/code-graph-backend/api/prompts.py(Line 24)Recommended Fix:
useAuth, etc.) and breaking down the UI into smaller, modular components.🚫 False Positives Identified (No Action Required)
During my manual review of the scan, the tool flagged multiple GitHub Issue Templates (
.github/ISSUE_TEMPLATE/*.yml) for "Use of 'any' type reduces type safety".This is a scanner bug caused by a TypeScript linting rule being incorrectly applied to plain English text inside YAML files. I have filtered these out, and the
.githubdirectory requires no changes.✅ Proposed Action Plan (Checklist)
I would love to help resolve these issues to improve the project! If the maintainers agree with these findings, we can break this down into the following PRs:
populate_db.sqland remove hardcoded mock keys.index.html.falkorsubmodule.@maintainers: Please let me know which of these you consider the highest priority, and I would be happy to be assigned to work on it! 🚀
Record