Skip to content

fix/2.1: Add path validation and improve MIME detection#118

Merged
detain merged 1 commit into
masterfrom
fix/2.1-security-fix
May 23, 2026
Merged

fix/2.1: Add path validation and improve MIME detection#118
detain merged 1 commit into
masterfrom
fix/2.1-security-fix

Conversation

@detain
Copy link
Copy Markdown
Owner

@detain detain commented May 23, 2026

Summary

  • Add validateMediaPath() helper to prevent path traversal attacks in streamAudiobook()
  • Add finfo-based MIME detection with extension-based fallback for better security
  • Update tests to use paths that pass security validation

Security Fix

  • Path Traversal Prevention: The validateMediaPath() method now validates that audiobook files are within allowed media directories (/media/, /mnt/, /data/, /home/)
  • MIME Detection: Uses finfo for actual file type detection instead of relying solely on file extension

…obook

- Add validateMediaPath() to prevent path traversal attacks
- Add finfo-based MIME detection with extension fallback
- Update tests to use paths that pass security validation
@detain detain merged commit 88bd188 into master May 23, 2026
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@detain detain deleted the fix/2.1-security-fix branch May 23, 2026 11:19
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