Skip to content

fix: validate audio paths before metadata reads - #70

Open
KevinTran3011 wants to merge 1 commit into
fadelabs:mainfrom
KevinTran3011:security/codeql-research-findings
Open

fix: validate audio paths before metadata reads#70
KevinTran3011 wants to merge 1 commit into
fadelabs:mainfrom
KevinTran3011:security/codeql-research-findings

Conversation

@KevinTran3011

Copy link
Copy Markdown

Summary

Brief description of what this PR does and why.

Changes

  • ...
  • ...

Test Plan

How was this tested?

  • New tests added
  • Existing tests pass

Checklist

  • Tests pass (uv run pytest tests/ -x -q)
  • Linting passes (uv tool run ruff check src/ tests/)
  • Formatting passes (uv tool run ruff format --check src/ tests/)

@KevinTran3011

Copy link
Copy Markdown
Author

Research note: the CodeQL custom query identified a validation-order issue (CWE-22-style path confinement). multi_stem_masking called soundfile.info() before load_audio() applied validate_input_path(), so PHANTOM_AUDIO_DIR confinement could be bypassed for metadata reads. This patch validates every path first and uses the validated paths for both metadata and decoding. Please review the policy when PHANTOM_AUDIO_DIR is unset.

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