Repository navigation
Conversation
Element attributes matching data-[a-z0-9-]+ were admitted wholesale, including the data-hypit-* names the compiler uses for deferred media resources and sampling state. Authored attributes serialize before compiler-owned ones, and HTML parsing keeps the first duplicate, so an authored data-hypit-resource-src chose the URL the activation runtime promoted onto the element, bypassing typed Artifact binding. Reject authored attributes under the reserved prefix. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #449
Summary
assertAttributesinpackages/composition/src/track.tsadmitted anydata-[a-z0-9-]+attribute, including thedata-hypit-*names the compiler owns:data-hypit-resource-src/data-hypit-resource-href(deferred media activation) and the sampling/element-id attributes. Inpackages/html-program/src/document.tsauthored attributes serialize before the compiler-owneddeferredResource(...)call, and HTML keeps the first duplicate attribute — so an authoreddata-hypit-resource-src="https://evil/x"wins over the typed Artifact mapping, and the capture-scope runtime (packages/html-program/src/capture-scope.ts) promotes the attacker URL onto the element's realsrc/href. The capture host then fetches it — an SSRF primitive that also bypasses Artifact binding entirely.assertAttributesnow rejects any authoreddata-hypit-*name with a dedicated error (contains reserved attribute …). Legitimate emitters only usedata-caption-*anddata-fine-*namespaces — verified across the repo — so nothing valid is lost.Behavior relative to main
data-caption-atomdata-hypit-resource-srcassertVisualTrackIdentitythrowsreserved attribute data-hypit-resource-srcRed / green
packages/composition/test/track.test.ts: new case builds an element carryingdata-hypit-resource-srcand asserts rejection — on main the attribute is admitted silently.Verification
node --import tsx --test packages/composition/test/track.test.ts— 11 pass.pnpm check— clean.data-hypit-*throughelement.attributes(onlydata-caption-*/data-fine-*).Merge Danger
data-hypit-*attribute name get a validation error where they previously got silent (and broken) compiler-owned semantics.Checklist
Generated with Devin