Skip to content

fix(security): 2 improvements across 2 files - #1286

Open
tomaioo wants to merge 8 commits into
mlco2:masterfrom
tomaioo:fix/security/sql-echo-enabled-in-production-database-
Open

fix(security): 2 improvements across 2 files#1286
tomaioo wants to merge 8 commits into
mlco2:masterfrom
tomaioo:fix/security/sql-echo-enabled-in-production-database-

Conversation

@tomaioo

@tomaioo tomaioo commented Aug 2, 2026

Copy link
Copy Markdown

Summary

fix(security): 2 improvements across 2 files

Problem

Severity: Medium | File: carbonserver/carbonserver/api/infra/database/database_manager.py:L15

The Database class initializes the SQLAlchemy engine with echo=True. This causes the engine to log all SQL statements and parameters to the console/logs. In a production environment, this can lead to sensitive data exposure (e.g., user data, tokens, or PII being included in query parameters) and significantly increases log volume, potentially degrading system performance.

Solution

Remove echo=True or make it configurable via an environment variable so it defaults to False in production environments.

Changes

  • carbonserver/carbonserver/api/infra/database/database_manager.py (modified)
  • carbonserver/carbonserver/api/routers/users.py (modified)

tomaioo added 2 commits August 2, 2026 12:13
- Security: SQL Echo Enabled in Production Database Engine
- Security: Missing Authorization Check on Get User By ID Endpoint

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
- Security: SQL Echo Enabled in Production Database Engine
- Security: Missing Authorization Check on Get User By ID Endpoint

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
@tomaioo
tomaioo requested a review from a team as a code owner August 2, 2026 19:13

@SaboniAmine SaboniAmine left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!
The /users/{user_id} endpoint being not used anymore, we'll simply remove it in a follow up PR, thanks for identifying the issue!

Comment thread carbonserver/carbonserver/api/infra/database/database_manager.py
Comment thread carbonserver/carbonserver/api/routers/users.py Outdated
tomaioo added 6 commits August 3, 2026 13:40
…g easier on the prod i

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
…does not exist

```sugg

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
…g easier on the prod i

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
…g easier on the prod i

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
…g easier on the prod i

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
…g easier on the prod i

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants