Skip to content

Security

manish singh edited this page Jul 25, 2026 · 1 revision

Security

Veloura processes files, URLs, metadata, and external decoder output. Treat those boundaries as untrusted even when the audio engine itself is small.

The repository's authoritative reporting instructions live in SECURITY.md. Do not place credentials or exploit details in a public issue.

Secrets

  • Store Discord tokens, cookies, proxy credentials, and PyPI credentials in environment or secret-management systems.
  • Never place a token in a query, track title, payload, exception message, or committed configuration.
  • Prefer PyPI Trusted Publishing over long-lived API tokens.
  • Escape resolved titles before displaying them in chat or HTML.
  • Redact signed media URLs from logs.

If a secret is committed, removing the line is not enough. Revoke and rotate it because it remains in Git history and may already have been copied.

Stream resolution

The default scheme policy rejects local-file and FTP-style URLs. It does not prevent every server-side request forgery scenario. A public backend should also consider:

  • Private and loopback IP ranges.
  • DNS rebinding.
  • Redirect destinations.
  • Proxy and egress allowlists.
  • Cloud metadata endpoints.
  • Maximum response and execution time.

Use resolver timeouts, concurrency limits, rate limits, and queue limits together. No single control is sufficient.

Subprocesses

Veloura builds FFmpeg commands as argument lists and does not use a shell for audio commands. Continue that pattern in integrations. Never concatenate user input into shell=True commands.

Timed yt-dlp work runs in a child process so it can be terminated. Process isolation limits lifecycle problems; it is not a general sandbox for hostile media parsers.

Keep FFmpeg, yt-dlp, Python, and the operating system patched.

File output

render_lossless_transition() creates parent directories and can overwrite output by default. For APIs that accept user-selected destinations:

  • Resolve paths against an application-owned root.
  • Reject traversal outside that root.
  • Generate server-side filenames where possible.
  • Set storage quotas.
  • Use overwrite=False when replacement is not intended.

Cache

The cache contains source identity and analysis metadata, not audio samples. Still treat it as application data:

  • Use an application-owned directory.
  • Set appropriate filesystem permissions.
  • Bound entries and age.
  • Avoid placing access tokens in source strings.
  • Do not share a writable cache between mutually untrusted tenants without another isolation layer.

Discord bots

  • Require voice-channel membership.
  • Restrict control commands.
  • Escape mentions and Markdown.
  • Rate-limit /play.
  • Keep queue and resolver limits.
  • Do not echo raw exceptions or media URLs publicly.
  • Grant the bot only the permissions it needs.

Dependency and release practice

  • Review dependency updates.
  • Run the full test matrix.
  • Run a dependency vulnerability audit before release.
  • Build from a tagged commit.
  • Match the tag exactly to pyproject.toml.
  • Publish through the protected pypi environment and Trusted Publishing.
  • Never reuse a PyPI version or filename.

Reporting

Include:

  • Affected version.
  • Operating system and Python version.
  • Minimal reproduction.
  • Impact.
  • Whether public disclosure has occurred.

Do not include live tokens, private media, or user data in a report.

Clone this wiki locally