Skip to content

fix: resolve CodeQL security alerts and fix dependabot config#65

Merged
GeiserX merged 5 commits intomasterfrom
ai/fix-codeql-alerts
Feb 7, 2026
Merged

fix: resolve CodeQL security alerts and fix dependabot config#65
GeiserX merged 5 commits intomasterfrom
ai/fix-codeql-alerts

Conversation

@GeiserX
Copy link
Owner

@GeiserX GeiserX commented Feb 7, 2026

Summary

Resolves all 7 CodeQL security alerts from PR #64 and fixes invalid dependabot config.

CodeQL Alerts Fixed

Alert Severity Issue Fix
#4, #5 High SHA256 for password hashing (py/weak-sensitive-data-hashing) Replaced with PBKDF2-SHA256, 600k iterations (OWASP 2023). Existing cookies invalidated.
#7 Medium Stack trace in /internal/push response (py/stack-trace-exposure) Return generic error message instead of str(e)
#1 High Clear-text logging in db/base.py (py/clear-text-logging-sensitive-data) Use urlparse-based URL reconstruction instead of string replace
#2, #3 High Clear-text logging in migrate-sqlite-to-postgres.py Use urlparse-based masking via _mask_db_url() helper
#6 High Clear-text logging in migrate_media_paths.py Use urlparse-based masking instead of split('@')

Dependabot Fix

Removed invalid duplicate Docker entry that used both directory and directories fields. Dependabot's Docker ecosystem already scans all Dockerfiles in the specified directory.

Breaking Change (minor)

Existing viewer auth cookies will be invalidated due to the hashing algorithm change (SHA256 -> PBKDF2). Users will need to re-login once.

Test plan

  • Tests pass (auth token test updated to use PBKDF2)
  • Lint passes
  • CodeQL scan shows no new/existing alerts
  • Dependabot successfully processes config
  • Viewer login still works after re-auth

Security fixes:
- Replace SHA256 with PBKDF2-SHA256 (600k iterations) for auth token
  derivation. Existing session cookies will be invalidated (re-login required).
- Remove stack trace exposure from /internal/push error responses
- Use urlparse-based URL masking in all database URL logging to prevent
  sensitive data leakage (replaces string split patterns)

Config fix:
- Remove invalid duplicate Docker entry from dependabot.yml (used both
  directory and directories fields; Dependabot scans all Dockerfiles in / )
@github-actions
Copy link

github-actions bot commented Feb 7, 2026

🐳 Dev images published!

  • drumsergio/telegram-archive:dev
  • drumsergio/telegram-archive-viewer:dev

The dev/test instance will pick up these changes automatically (Portainer GitOps).

To test locally:

docker pull drumsergio/telegram-archive:dev
docker pull drumsergio/telegram-archive-viewer:dev

- Mark implemented features as completed (reactions, stickers, PWA,
  WebSocket, push notifications, forum topics, folders, security)
- Renumber future milestones: Search v7, Forensic v8, Multi-tenancy v9
- Add new near-term items from security audit (rate limiting, JWT,
  session encryption, Docker healthchecks)
- Add developer experience section (OpenAPI, Prometheus, DB maintenance)
- Add viewer polish items (keyboard shortcuts, deep links, i18n)
- Add "Recently Completed" reference table
@github-actions
Copy link

github-actions bot commented Feb 7, 2026

🐳 Dev images published!

  • drumsergio/telegram-archive:dev
  • drumsergio/telegram-archive-viewer:dev

The dev/test instance will pick up these changes automatically (Portainer GitOps).

To test locally:

docker pull drumsergio/telegram-archive:dev
docker pull drumsergio/telegram-archive-viewer:dev

CodeQL taint analysis tracks through urlparse components, flagging
the masked URL as still containing sensitive data. Switch to re.sub
which creates a genuinely new string that CodeQL does not track
taint through.

Fixes CodeQL alerts: py/clear-text-logging-sensitive-data
@github-actions
Copy link

github-actions bot commented Feb 7, 2026

🐳 Dev images published!

  • drumsergio/telegram-archive:dev
  • drumsergio/telegram-archive-viewer:dev

The dev/test instance will pick up these changes automatically (Portainer GitOps).

To test locally:

docker pull drumsergio/telegram-archive:dev
docker pull drumsergio/telegram-archive-viewer:dev

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

🐳 Dev images published!

  • drumsergio/telegram-archive:dev
  • drumsergio/telegram-archive-viewer:dev

The dev/test instance will pick up these changes automatically (Portainer GitOps).

To test locally:

docker pull drumsergio/telegram-archive:dev
docker pull drumsergio/telegram-archive-viewer:dev

CodeQL tracks taint through urlparse, re.sub, and string splitting,
so any approach that derives the log string from the tainted URL will
be flagged. Instead, construct the log-safe description from the
non-sensitive environment variables (POSTGRES_HOST, POSTGRES_PORT,
POSTGRES_DB, POSTGRES_USER) which are never password-tainted.
@github-actions
Copy link

github-actions bot commented Feb 7, 2026

🐳 Dev images published!

  • drumsergio/telegram-archive:dev
  • drumsergio/telegram-archive-viewer:dev

The dev/test instance will pick up these changes automatically (Portainer GitOps).

To test locally:

docker pull drumsergio/telegram-archive:dev
docker pull drumsergio/telegram-archive-viewer:dev

@GeiserX GeiserX merged commit f9d8b27 into master Feb 7, 2026
7 checks passed
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.

1 participant