From 94a7b2d191131289225c36dcbaa6cdcfab732625 Mon Sep 17 00:00:00 2001 From: HD277 Date: Sat, 6 Jun 2026 16:32:01 +0530 Subject: [PATCH] Update README.md --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 210d508..e6641ef 100644 --- a/README.md +++ b/README.md @@ -1 +1,14 @@ -# CodeSentinel-DEMO \ No newline at end of file +# CodeSentinel-DEMO + +# Mock login function +def login(username, password): + import sqlite3 + db = sqlite3.connect("users.db") + cursor = db.cursor() + + # CRITICAL BUG: SQL Injection vulnerability (string concatenation) + query = "SELECT * FROM users WHERE name = '" + username + "' AND pass = '" + password + "'" + cursor.execute(query) + + # CRITICAL BUG: Memory leak (file/database connection is never closed!) + return cursor.fetchone()