Security fixes: add authentication to unprotected endpoints, replace deprecated Flask-Talisman, fix session cookie, add WebSocket auth check, improve error handling

This commit is contained in:
Reditus committed 2026-05-14 23:04:18 +01:00
1 parent 5fddd72e69
commit 9bc68c6d4f
5 files changed
+91 -20

No files matched your search

+9 -2
View File
@@ -404,15 +404,22 @@ class AdminService:
for name, sql in indexes:
try:
cur.execute(sql)
conn.commit()
created.append(name)
except Exception as e:
logger.warning(f"Index {name} failed: {e}")
conn.commit()
try:
conn.rollback()
except Exception:
pass
return True, created, None
except Exception as e:
logger.error(f"Failed to create indexes: {e}")
if conn:
conn.rollback()
try:
conn.rollback()
except Exception:
pass
return False, [], str(e)
finally:
if cur: