Skip to content

[Precogs AI - Fix] SQL Injection (High) in sample-vuln/sam.py#7

Open
sameer6pre wants to merge 1 commit intoPrecogs-fix-5kqi2b08from
precogs/auto-fix/high-1774611167982
Open

[Precogs AI - Fix] SQL Injection (High) in sample-vuln/sam.py#7
sameer6pre wants to merge 1 commit intoPrecogs-fix-5kqi2b08from
precogs/auto-fix/high-1774611167982

Conversation

@sameer6pre
Copy link
Copy Markdown
Owner

Precogs Auto-Fix

Vulnerability: SQL Injection
Severity: High
File: sample-vuln/sam.py
CWE: CWE-89

What was fixed

The code constructs an SQL query by interpolating the 'username' parameter directly into the query string using an f-string. This allows an attacker to craft a specially formed username that alters the SQL statement's logic (SQL injection). There is no parameterization or sanitization, and the query is executed directly by sqlite3, leading to data disclosure or modification.

This PR was automatically generated by Precogs AI. Review the changes before merging.

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