Skip to content

fix: harden on_media_cb codec auth and FFI tls_insecure handling - #218

Closed
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/application-security-review-26aa
Closed

fix: harden on_media_cb codec auth and FFI tls_insecure handling#218
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/application-security-review-26aa

Conversation

@cursor

@cursor cursor Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Security review fixes

This PR addresses two validated findings from the scheduled application-security scan (commit 1fcbe51).

1. Unknown codec identity bypasses deny-list on_media_cb authorization (Medium) — #216

  • Location: src/session/conn.rs
  • Impact: Remote publishers could relay media past codec deny-list policies when codec detection returned None (non-UTF-8 FourCC bytes or unknown legacy codec nibbles).
  • Fix: Surface stable codec labels (fourcc:…, legacy:…) to on_media_cb, deny frames with no codec identity when the callback is registered, and add regression tests.

2. Uninitialized ServerConfig.tls_insecure disables RTMPS verification (High) — #217

  • Location: src/lib.rs, include/librtmp2/librtmp2.h
  • Impact: FFI embedders passing non-zero-initialized ServerConfig could silently disable TLS certificate verification for lrtmp2_client_create().
  • Fix: Require tls_insecure == 1 exactly (not any non-zero garbage) before enabling insecure mode; document the contract in the public header.

Closes #216 and #217.

Open in Web View Automation 

- Surface non-UTF-8 FourCC and unknown legacy codec nibbles to on_media_cb
  via stable labels instead of None, and deny frames with no codec identity
- Require tls_insecure == 1 (not any non-zero) to disable RTMPS verification

Co-authored-by: Alexander Wagner <info@alexanderwagnerdev.com>
@AlexanderWagnerDev
AlexanderWagnerDev deleted the cursor/application-security-review-26aa branch August 15, 2026 20:50
AlexanderWagnerDev added a commit that referenced this pull request Aug 15, 2026
PR #218 added a test using LazyLock without the local import that
other conn.rs tests use, causing cargo test and sanitizer jobs to fail
at compile time.

Co-authored-by: Alexander Wagner <info@alexanderwagnerdev.com>
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.

Unknown codec identity as None bypasses deny-list on_media_cb authorization

2 participants