Skip to content

Add security audit report with 5 high/critical findings#1

Merged
blaineam merged 5 commits intomainfrom
claude/security-audit-7Kx7P
Apr 6, 2026
Merged

Add security audit report with 5 high/critical findings#1
blaineam merged 5 commits intomainfrom
claude/security-audit-7Kx7P

Conversation

@blaineam
Copy link
Copy Markdown
Owner

@blaineam blaineam commented Apr 6, 2026

Full static analysis of all Swift source files, CI/CD workflows, and
configuration. Key findings include: WKWebView granted root filesystem
read access, HTML/JS injection via unsanitized URL interpolation,
CI script injection in release workflow, and decrypted media written
to temp files without file protection.

https://claude.ai/code/session_01Hn6V9QEs5Wgcj2eRmpkezN

claude and others added 5 commits April 6, 2026 13:59
Full static analysis of all Swift source files, CI/CD workflows, and
configuration. Key findings include: WKWebView granted root filesystem
read access, HTML/JS injection via unsanitized URL interpolation,
CI script injection in release workflow, and decrypted media written
to temp files without file protection.

https://claude.ai/code/session_01Hn6V9QEs5Wgcj2eRmpkezN
- CRITICAL: Scope WKWebView file access to common ancestor directory
  instead of granting read access to entire filesystem root (/)
- HIGH: HTML-escape URL values interpolated into video HTML template
  to prevent XSS via crafted media URLs
- HIGH: Sanitize evaluateJavaScript inputs (hex colors filtered to
  valid chars, numeric values clamped/validated for finiteness)
- HIGH: Add .completeFileProtection to decrypted temp files and
  other sensitive temp file writes
- HIGH: Fix CI script injection by using env vars instead of inline
  ${{ }} interpolation in shell commands
- MODERATE: Add Content-Security-Policy meta tag to WKWebView HTML
- MODERATE: Add HTTP header sanitization rejecting control characters
  to prevent header injection attacks
- MODERATE: Verify destination file integrity before removing originals
  during encryption migration to prevent data loss
- MODERATE: Pin softprops/action-gh-release to commit SHA

https://claude.ai/code/session_01Hn6V9QEs5Wgcj2eRmpkezN
- Fix decrypted temp file leak: clean up temp file in catch block when
  decryption or write fails in playbackURL(), preventing plaintext
  media from persisting on disk after errors
- Gate all debug print statements behind #if DEBUG across
  MediaDownloadManager, WebViewVideoPlayer, and VideoMetadata to
  prevent information disclosure (file paths, error details, operation
  status) in production builds

https://claude.ai/code/session_01Hn6V9QEs5Wgcj2eRmpkezN
- Clamp targetSize in generateThumbnailInternal to [1, 4096] — it was
  unbounded unlike the other thumbnail codepath, allowing callers to
  trigger massive canvas allocations
- Cap canvas height to 4096px in both thumbnail JS codepaths to prevent
  memory exhaustion when videoHeight approaches zero (division yields
  NaN/Infinity, or extreme aspect ratios yield millions of pixels)
- The `|| targetWidth` fallback handles NaN from division-by-zero
- Tighten CSP: add connect-src, frame-src, object-src 'none' to block
  fetch/XHR data exfiltration and iframe/plugin embedding

https://claude.ai/code/session_01Hn6V9QEs5Wgcj2eRmpkezN
Break Content-Security-Policy meta tag across multiple lines to stay
under the 200-character line limit enforced by CI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@blaineam blaineam force-pushed the claude/security-audit-7Kx7P branch from 5b47520 to 5b85139 Compare April 6, 2026 21:02
@blaineam blaineam merged commit 7c21224 into main Apr 6, 2026
5 checks passed
@blaineam blaineam deleted the claude/security-audit-7Kx7P branch April 7, 2026 01:55
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.

2 participants