Skip to content

fix: secure legacy database path#4

Merged
ichwars merged 1 commit into
mainfrom
codex/fix-legacy-database-path
Jul 10, 2026
Merged

fix: secure legacy database path#4
ichwars merged 1 commit into
mainfrom
codex/fix-legacy-database-path

Conversation

@ichwars

@ichwars ichwars commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • build the dynamically named legacy database path with safe_join_under()
  • satisfy the path-arithmetic security guard in both native and Docker backend tests

Root cause

The PrintOps migration retained support for a legacy database filename assembled at runtime. Joining that dynamic name directly with settings.base_dir was rejected by the repository's unsafe-path regression test.

Validation

  • pytest backend/tests/unit/test_no_unsafe_path_joins.py backend/tests/integration/test_system_api.py --tb=short (34 passed)
  • ruff check backend/app/api/routes/system.py
  • ruff format --check backend/app/api/routes/system.py
  • git diff --check

@ichwars
ichwars marked this pull request as ready for review July 10, 2026 11:07
@ichwars
ichwars merged commit 0a7ae3b into main Jul 10, 2026
14 checks passed
@ichwars
ichwars deleted the codex/fix-legacy-database-path branch July 10, 2026 11:08
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