[高] 数据库DEBUG=True时SQL echo泄漏查询日志 #88
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题描述
backend/app/core/database.py 第15行,当 DEBUG=True(当前默认值)时 SQLAlchemy 的 echo=True 会打印所有 SQL 查询到控制台,生产环境中可能泄漏敏感数据。
涉及文件
修复建议
echo 应独立于 DEBUG 配置,生产环境强制关闭。
严重程度
高 - 数据泄漏风险