From a9f5e921934899c4186366e52e7dcb2ec3ab0a75 Mon Sep 17 00:00:00 2001 From: Mahaboob Shaik Date: Fri, 12 Jun 2026 11:55:57 +0100 Subject: [PATCH 1/2] Remove Windows Zone.Identifier files --- docs/images/arch.png:Zone.Identifier | Bin 291 -> 0 bytes logo.png:Zone.Identifier | Bin 618 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 docs/images/arch.png:Zone.Identifier delete mode 100644 logo.png:Zone.Identifier diff --git a/docs/images/arch.png:Zone.Identifier b/docs/images/arch.png:Zone.Identifier deleted file mode 100644 index 2d1b0619437074e446f67a2ee71df63c5594a785..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 291 zcmZ{c%}T{E5Jp`W`WoHUWZE=8LU5~F(TyT9nN032Uel69!MC?ATzYojf$zLLZDMV+}d7mgrGCF)84LW`w%2FLI`%k(db!?cIGf5q8Zhq z95@>cQ0Tk6t+xLf0qLD{9C2R-*Y=6!ThNvp=XSeBpVkY%$v=`(W|HU(YpE^qlx&Dd zL#tjnwMaSaKGj?YI<7F(_2i>X2v%_fm@GhY3$YAwN+}>ODjKKZ(1t-J$^bp#P- MO?u&F`111V2h8zWA1b#7L$zs zn)x;D22c9gLCK?^c2NI3qD8CP9=g`LQ^0?TQ_6$h=)-gTAHl!!QG?~60y^{km{*f5 Y;E%Tl*}NkxV8RQ|1of@S?PB%r4TxL5C;$Ke From 7aac912fe058cda809f61c8c4eda8c785596e528 Mon Sep 17 00:00:00 2001 From: Mahaboob Shaik Date: Fri, 12 Jun 2026 11:57:53 +0100 Subject: [PATCH 2/2] Fix SQL injection vulnerability in Redshift fetch_table --- src/connectors/redshift.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/connectors/redshift.py b/src/connectors/redshift.py index 98d5b0a..1fcfe26 100644 --- a/src/connectors/redshift.py +++ b/src/connectors/redshift.py @@ -1,7 +1,7 @@ import psycopg2 import pandas as pd from typing import List - +from psycopg2 import sql def connect(host: str, port: int, database: str, user: str, password: str): """Establish a connection to Amazon Redshift. @@ -73,14 +73,19 @@ def fetch_table(host: str, port: int, database: str, user: str, password: str, t Raises: psycopg2.Error: If connection or query fails + ValueError: If table name is invalid """ + if not table.replace('_', '').isalnum(): + raise ValueError(f"Invalid table name: {table}") + conn = connect(host, port, database, user, password) cursor = conn.cursor() try: - cursor.execute(f"SELECT * FROM {table} LIMIT {limit}") + query = sql.SQL("SELECT * FROM {} LIMIT %s").format(sql.Identifier(table)) + cursor.execute(query, (limit,)) columns = [desc[0] for desc in cursor.description] rows = cursor.fetchall() return pd.DataFrame(rows, columns=columns) finally: cursor.close() - conn.close() + conn.close() \ No newline at end of file