Merge pull request #3966 from remo-lab/fix/sql-injection-truncate

Fix SQL injection in truncate_data_tables
This commit is contained in:
Sarah Hoffmann
2026-02-05 14:44:55 +01:00
committed by GitHub

View File

@@ -195,7 +195,7 @@ def truncate_data_tables(conn: Connection) -> None:
WHERE tablename LIKE 'location_road_%'""")
for table in [r[0] for r in list(cur)]:
cur.execute('TRUNCATE ' + table)
cur.execute(pysql.SQL('TRUNCATE {}').format(pysql.Identifier(table)))
conn.commit()