Skip to content

Harden preview script CSP#409

Open
yusufm wants to merge 1 commit into
schuyler:mainfrom
yusufm:Codex/fix-preview-csp-019def52-b3da-7962-96cd-afa05d8d1592
Open

Harden preview script CSP#409
yusufm wants to merge 1 commit into
schuyler:mainfrom
yusufm:Codex/fix-preview-csp-019def52-b3da-7962-96cd-afa05d8d1592

Conversation

@yusufm
Copy link
Copy Markdown
Contributor

@yusufm yusufm commented May 3, 2026

Summary

  • add per-render nonces to renderer-owned preview script tags
  • remove broad file/self script sources and outbound connect permission from the preview CSP
  • add regression coverage for nonce-bearing app scripts and document-supplied file scripts

Validation

  • bundle exec pod install
  • xcodebuild test -workspace "MacDown 3000.xcworkspace" -scheme MacDown -only-testing:MacDownTests/MPAssetTests -only-testing:MacDownTests/MPRendererEdgeCaseTests/testPreviewRenderIncludesContentSecurityPolicyAndCheckboxToken -only-testing:MacDownTests/MPRendererEdgeCaseTests/testPreviewCSPBlocksDocumentSuppliedFileScripts -destination 'platform=macOS'

Related to security review finding: Preview CSP allows local script execution.

@yusufm yusufm marked this pull request as ready for review May 3, 2026 19:56
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.

1 participant