You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(media): correct legacy folder resolution, ACL bypass, and review findings
* fix(media): correct fallback logic, ACL bypass, and migration cleanup
- Extract shared media_utils.py with proper arithmetic for Telegram
marked-ID resolution (fixes channel fallback producing wrong paths)
- Fix ACL bypass: enforce access control against resolved path, not URL
- Fix entrypoint crash when media table doesn't exist on pre-v6 databases
- Remove dead _BATCH_SIZE constant and identical dialect branches in migration
- Add try/except for RuntimeError (symlink loops) in fallback paths
- Add debug logging to fallback and ACL legacy grant paths
- Fix except syntax to use parenthesized tuple form
- Add 25 unit tests for media_utils with roundtrip consistency checks
- Bump version to 7.10.15
* fix(media): handle non-numeric folder names in legacy_folder_alternates
Return empty list for non-numeric folders (e.g., "chat1") instead of
raising ValueError. Fixes test_web_thumbnails failure on CI.
* style: format test_media_utils.py
* fix(media): address review findings — PII logs, thumbnail ACL, boundary tests
- Strip chat IDs from all debug log statements (PII compliance)
- Fix thumbnail ACL bypass: ensure_thumbnail now returns resolved folder
so serve_thumbnail checks ACL on the actual resolved path
- Simplify serve_media path reconstruction (str(relative_to) vs manual join)
- Guard folder_int <= 0 in legacy_folder_alternates
- Fix import style in thumbnails.py (absolute → relative)
- Add boundary tests for exact CHANNEL_ID_OFFSET inflection point
- Add integration tests for ACL bypass scenario (deny + allow)
* fix(media): restore early ACL check in serve_thumbnail for defense-in-depth
Keep the pre-resolution ACL check (prevents file existence leakage), and
add a secondary check only when the resolved folder differs from the
requested folder (prevents bypass via legacy fallback).
0 commit comments