fix(security): resolve open CodeQL alerts (XSS, sanitization, workflow perms) - #3419
Merged
Merged
Conversation
…w perms) - #108 (high, js/xss-through-dom): preview.tsx assigned user-typed input to iframe.src / anchor href, allowing javascript:/data: URIs to execute in the preview context. Gate every URL sink through an http(s)-only validator. - #95 (high, js/incomplete-sanitization): generate-task-types.ts escaped single quotes but not backslashes when embedding task fields in single-quoted TS string literals. Add a helper that escapes backslash-first and apply it to id/name/department/frequency. - #80/#81/#84/#85 (medium, actions/missing-workflow-permissions): the two Trigger.dev deploy + two DB-migration workflows had no permissions block. Add top-level 'permissions: contents: read' (they only check out to build/ deploy/migrate — no repo writes). Verified: app typecheck clean for preview.tsx; codegen script typechecks; all 4 workflow YAMLs valid. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 6 files
Confidence score: 5/5
- Safe to merge after the addressed issues were fixed.
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
loadNewUrl navigated the iframe imperatively (iframeRef.current.src) without updating currentUrl, so the external-link href, refresh, and try-again all referred to the stale previous URL. Drive navigation through setCurrentUrl instead (the iframe src prop follows currentUrl/safeUrl), keeping every URL consumer in sync with what's shown — and avoiding a double-load from setting both iframe.src and the src prop. Same-URL entries still go through refreshIframe's cache-bust. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
claudfuen
pushed a commit
that referenced
this pull request
Jul 15, 2026
# [3.102.0](v3.101.2...v3.102.0) (2026-07-15) ### Bug Fixes * **ci:** pin Syft 1.46.0 in SBOM action (1.42.3 can't parse bun.lock) ([#3415](#3415)) ([5f47024](5f47024)) * **ci:** scan bun.lock via file: input so the SBOM isn't empty ([#3414](#3414)) ([e47e6fd](e47e6fd)) * **deps:** override uuid to ^11.1.1 (Dependabot [#85](#85)) ([#3418](#3418)) ([598ff8c](598ff8c)) * **deps:** patch tmp and js-yaml in mcp-server (Dependabot [#58](https://github.com/trycompai/comp/issues/58)/[#59](https://github.com/trycompai/comp/issues/59)/[#71](https://github.com/trycompai/comp/issues/71)) ([#3412](#3412)) ([59a6b0f](59a6b0f)) * **deps:** remediate dependency security vulnerabilities ([#3403](#3403)) ([7577a37](7577a37)) * **deps:** remediate dependency security vulnerabilities (165→16, 4 critical→0) ([#3406](#3406)) ([d403e9c](d403e9c)) * **device-agent:** implement the installer-cleanup fix ([#3381](#3381)) ([0f7581b](0f7581b)) * **security:** prevent SSRF in task-automation enterprise API calls ([#3411](#3411)) ([dcec288](dcec288)), closes [#116](#116) * **security:** resolve open CodeQL alerts (XSS, sanitization, workflow perms) ([#3419](#3419)) ([32329be](32329be)), closes [#108](#108) [js/xss-throu#dom](https://github.com/js/xss-throu/issues/dom) [#95](#95) [84/#85](#85) ### Features * **framework-editor:** raise requirement description limit to 100,000 chars (FRAME-2) ([67c9f4a](67c9f4a))
Contributor
|
🎉 This PR is included in version 3.102.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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
Resolves the 6 open CodeQL code-scanning alerts.
#108 — DOM XSS (High,
js/xss-through-dom) — the real onepreview.tsx(automation preview) assigned user-typed input straight toiframe.srcand<a href>, so a value likejavascript:alert(document.cookie)ordata:text/html,...would execute in the preview context.Fix: a
toSafeUrl()validator that only passeshttp:/https:URLs; every URL sink (iframe src, anchor href, refresh, load-new-url) now goes through it, and invalid input shows an error instead of navigating. Also addedrel="noopener noreferrer"to the external link.#95 — Incomplete sanitization (High,
js/incomplete-sanitization)generate-task-types.ts(codegen) escaped single quotes but not backslashes when embedding task fields in single-quoted TS literals (a trailing\or\'breaks out).department/frequency/idweren't escaped at all.Fix: a
sq()helper that escapes backslash-first, then quote, applied to id/name/department/frequency. (Codegen script, non-runtime, but now correct.)#80 / #81 / #84 / #85 — Missing workflow permissions (Medium ×4)
The two Trigger.dev deploy + two DB-migration workflows had no
permissions:block (inheriting broad default token scope).Fix: top-level
permissions: contents: readon each — they only check out to build/deploy/migrate, no repo writes.Verification
permissions: {contents: read}Closes CodeQL #108, #95, #80, #81, #84, #85 (on next scan of
mainafter merge).🤖 Generated with Claude Code
Summary by cubic
Fixes 6 CodeQL alerts by blocking unsafe URLs in the automation preview, fixing string escaping in codegen, and restricting GitHub Actions permissions. Also drives preview navigation through state to keep links/refresh in sync and avoid double loads.
toSafeUrl()and used it for iframesrc, anchorhref, refresh, and load; invalid input shows an error; addedrel="noopener noreferrer"; navigation now goes through state so the external link, refresh, and retry match the shown URL and don’t double-load.sq()to escape backslash first, then quote; applied toid,name,department,frequency; kept template literal description with backslash-first escaping.permissions: contents: readto the two deploy and two database migration workflows.Written for commit e0690fb. Summary will update on new commits.