Skip to content

starboard: Ignore oversized CDM key IDs - #13534

Merged
jasonzhangxx merged 1 commit into
youtube:mainfrom
jasonzhangxx:cdm-key-check
Oct 21, 2026
Merged

jasonzhangxx merged 1 commit into
youtube:mainfrom
jasonzhangxx:cdm-key-check

Conversation

@jasonzhangxx

Copy link
Copy Markdown
Contributor

In DrmSystemWidevine::onKeyStatusesChange(), add a runtime size check against sizeof(sb_key_id.identifier) in addition to SB_DCHECK_LE. If a key ID exceeds the fixed buffer capacity in release builds, log an error and skip the entry instead of overflowing the stack buffer.

Bug: 545795885
TAG=agy
CONV=656ba36a-b871-49b8-b479-70b3cf6a0c7f

In DrmSystemWidevine::onKeyStatusesChange(), add a runtime size check
against sizeof(sb_key_id.identifier) in addition to SB_DCHECK_LE. If a
key ID exceeds the fixed buffer capacity in release builds, log an
error and skip the entry instead of overflowing the stack buffer.

Bug: 545795885
TAG=agy
CONV=656ba36a-b871-49b8-b479-70b3cf6a0c7f
@jasonzhangxx
jasonzhangxx requested review from a team and kjyoun October 20, 2026 23:12
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor
Context State Description
CI / All Pass ⏳ PENDING Checks are running
CI / android ✅ PASS Passed
CI / evergreen ⏳ PENDING Checks are running
CI / linux ✅ PASS Passed
CI / tvos ✅ PASS Passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a bounds check in DrmSystemWidevine::onKeyStatusesChange to prevent a potential buffer overflow when copying the key status identifier. If the identifier size exceeds the buffer size, an error is logged and the key is skipped. I have no feedback to provide as the implementation is correct and improves robustness.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


starboard: Ignore oversized CDM key IDs

Add a runtime size check for key IDs in onKeyStatusesChange to prevent
potential stack buffer overflows. While a debug-only check existed,
this ensures that release builds will log an error and skip any
oversized key IDs that exceed the SbDrmKeyId identifier capacity.

Bug: 545795885

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message
@jasonzhangxx
jasonzhangxx enabled auto-merge (squash) October 20, 2026 23:15
@jasonzhangxx
jasonzhangxx merged commit 97b6db7 into youtube:main Oct 21, 2026
1359 of 1409 checks passed
@jasonzhangxx
jasonzhangxx deleted the cdm-key-check branch October 21, 2026 18:35
cobalt-github-releaser-bot pushed a commit that referenced this pull request Oct 21, 2026
Refer to original PR: #13534

In DrmSystemWidevine::onKeyStatusesChange(), add a runtime size check
against sizeof(sb_key_id.identifier) in addition to SB_DCHECK_LE. If a
key ID exceeds the fixed buffer capacity in release builds, log an error
and skip the entry instead of overflowing the stack buffer.

Bug: 545795885
TAG=agy
CONV=656ba36a-b871-49b8-b479-70b3cf6a0c7f

(cherry picked from commit 97b6db7)
briantting pushed a commit that referenced this pull request Oct 22, 2026
Refer to original PR: #13534

In DrmSystemWidevine::onKeyStatusesChange(), add a runtime size check
against sizeof(sb_key_id.identifier) in addition to SB_DCHECK_LE. If a
key ID exceeds the fixed buffer capacity in release builds, log an error
and skip the entry instead of overflowing the stack buffer.

Bug: 545795885
TAG=agy
CONV=656ba36a-b871-49b8-b479-70b3cf6a0c7f

(cherry picked from commit 97b6db7)
briantting pushed a commit that referenced this pull request Oct 27, 2026
Refer to original PR: #13534

In DrmSystemWidevine::onKeyStatusesChange(), add a runtime size check
against sizeof(sb_key_id.identifier) in addition to SB_DCHECK_LE. If a
key ID exceeds the fixed buffer capacity in release builds, log an error
and skip the entry instead of overflowing the stack buffer.

Bug: 545795885
TAG=agy
CONV=656ba36a-b871-49b8-b479-70b3cf6a0c7f

(cherry picked from commit 97b6db7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants