feat(creator-motion-storyboard): capsule-to-storyboard controller route - #37
Merged
Merged
Conversation
Resolve the macOS shell utility case collision by replacing src/utils/shell.ts with src/utils/shellQuote.ts while preserving src/utils/Shell.ts.
… route Public-safe HTTP route that converts a capsule (JSON scene data) into a self-contained, fixed-canvas HTML motion storyboard. Includes: - JSON contract (capsule-v1 schema) with structural validation - Capsule-to-HTML transform with XSS-safe output escaping - Machine check: scene index, duration, element bounds validation - Append-only JSONL ledger retention - GitHub Actions CI workflow - 23 tests (contract, transform, validate, ledger) No raw generated media. CSP headers on all responses. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
I cannot approve this PR yet.
Blocking issue: the generated HTML is not actually public-safe. Capsule-originated CSS is interpolated directly into HTML style="..." attributes without escaping or sanitization:
styleentries are rendered as raw${k}:${v}inrenderSceneElements.scene.backgroundis rendered raw inside thescene-canvasstyle attribute.validateCapsuleonly checks the element numeric fields/type and does not validate/sanitizestylekeys/values orbackground.
A malicious capsule can break out of the style attribute with a quote-bearing CSS value/background and inject markup. CSP reduces script execution risk, but the PR claims all capsule-originated strings are escaped and the route is public-safe; this is currently false.
Please either:
- remove arbitrary
style/backgroundpassthrough from public input, or - strictly whitelist CSS properties and validate CSS values against safe patterns, then HTML-escape any final attribute fragments.
Add tests covering hostile style values and background values containing quotes / <img / event-handler payloads.
This branch was successfully 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.
Summary
New
@syndash/creator-motion-storyboardpackage — a public-safe capsule-to-motion-storyboard HTTP controller route.POST /capsule-to-storyboard— accepts a capsule JSON body, returns a self-contained fixed-canvas HTML motion storyboardcapsule-v1schema) with structural validation.ledger/storyboard-transforms.jsonl)Design decisions
esc()everywhere — every capsule-originated string passes through HTML entity encoding before renderingdefault-src 'none'; style-src 'unsafe-inline'— defense in depth beyond escaping<div>s — CSS classes (el-text,el-shape,el-placeholder) for theming; no raw generated mediaTest plan
bun test— 23/23 passbun run build— bundles to 9.24 KBEvidence
Closes DAS-234.