Skip to content

Phase 1: security and performance hardening - #1

Merged
tzero86 merged 19 commits into
mainfrom
fix/security-performance-audit
Oct 24, 2026
Merged

tzero86 merged 19 commits into
mainfrom
fix/security-performance-audit

Conversation

@tzero86

@tzero86 tzero86 commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Summary

Phase 1 security and performance hardening from docs/audit/security-performance-2026-10-24.md.

Security

  • Contain archive extraction paths in Dart and Kotlin to prevent zip-slip.
  • Sanitize CloudStream extension names, temp directories, and shell invocation.
  • Validate book IDs, file extensions, and persisted download paths; retain prior user-picked download roots.
  • Restore TLS certificate validation across all HTTP clients.
  • Generate and verify SHA256SUMS; block automatic installation of unverified releases.
  • Redact credentials and signed URLs from player, IPTV, proxy, scraper, and subtitle logs.
  • Harden MegaProxy with a 256-bit token, strict token path, loopback-only CORS, OPTIONS handling, and a 32-file cap.

Performance

  • Debounce EPUB progress writes; reduce player and audiobook saves to 30-second intervals.
  • Stop hidden Home listeners from rebuilding/refetching; remove the duplicate Home update check.
  • Bound manga thumbnail precache and debounce manga progress writes.
  • Debounce IPTV portal search.
  • Downscale the blurred music backdrop.
  • Cache player artwork and isolate video repaint with RepaintBoundary.

Verification

  • flutter analyze — no issues.
  • flutter test — 1,295 passed, 13 skipped.
  • New Dart files pass dart format; existing formatter drift in legacy files was left untouched to keep the diff reviewable.

Deferred

IPTV SecureStore migration, TorrServer exposure, remaining architecture-heavy security items, and manga page-pitch accuracy.

Closes the Phase 1 audit scope only; follow-up branches remain for the deferred items.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-24T13:59:59.652602Z edbb27d Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1de3ba8876

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/pages/player/player_screen.dart
Comment thread lib/services/download/download_service.dart
@tzero86

tzero86 commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

Review follow-up pushed in 98a29a0 and edbb27d. All four checks are green.

Addressed:

  • Invalid book IDs no longer disable or crash the book CTA; malformed Bookracy results are filtered, and _checkingStatus clears on failure.
  • Download execution revalidates targetFilePath against trusted roots, so retrying a rejected persisted task cannot write outside configured folders.
  • Player exception/stack text is redacted before breadcrumbs and print, and the normalized stream URI is restored.
  • Remaining signed URLs in Stremio subtitles, HindMoviez, and Cinejoy logs are redacted.
  • CloudStream uninstall/update now checks legacy unsanitized filenames without allowing path escape.
  • Audiobook pause/seek flush progress; Trakt public sections retry after a failed load instead of staying suppressed for the session.
  • Added regression tests for malformed book IDs and custom download-root history.
  • Formatted every changed Dart file; the formatting gate now passes.

Note: a task stored in a custom download folder selected before this release, where that folder is no longer current, is marked invalid once. Re-selecting the folder makes it retryable.

Tests: 1,297 passed, 13 skipped.

@codex review

@tzero86
tzero86 merged commit 1574d98 into main Oct 24, 2026
4 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