Skip to content

[Security] Fix CodeQL alert #14: SQL query built from user-controlled sources#82

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
security/codeql-14-sql-injection-login
Open

[Security] Fix CodeQL alert #14: SQL query built from user-controlled sources#82
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
security/codeql-14-sql-injection-login

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented Mar 25, 2026

Summary

Replaces string concatenation with a parameterized query (? placeholders + parameter tuple) in the /login endpoint of vulnerable_sql_injection.py. This prevents user-supplied username and password values from altering the SQL query structure (CWE-089).

Review & Testing Checklist for Human

  • Verify the database driver is Python's sqlite3 module (which uses ?-style placeholders). If the app uses a different driver (e.g., psycopg2 uses %s, SQLAlchemy text() uses :param), the placeholder syntax needs to change.
  • Test login manually: confirm valid credentials still authenticate, and that ' OR 1=1-- as username no longer bypasses auth.

Notes

Link to Devin session: https://app.devin.ai/sessions/09fa16db2840475588405dabc15c3e1d
Requested by: @colin-d-fried


Open with Devin

…sources

Co-Authored-By: cfried123 <cfried123@yahoo.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant