fix(security): close CodeQL alerts for URL sanitization and workflow permissions - #55
Merged
Conversation
…permissions The figma.com host check used endsWith(), which a host like evil-figma.com would satisfy without being Figma's domain. The Quality Gate workflow also ran PRs (including from forks) with the default GITHUB_TOKEN permissions instead of a scoped-down set. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
dryor
added a commit
that referenced
this pull request
Aug 11, 2026
Merging main (PR #55) brought in a test added after this branch was cut, still calling the pre-rename resolveUrl. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
dryor
added a commit
that referenced
this pull request
Aug 11, 2026
PR #55 (security fix) merged to main without a changeset, so its patch bump was never queued. Adding it here alongside this PR's own changeset since this branch already has main merged in. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
js/incomplete-url-substring-sanitization, high):parseFigmaUrl()inpackages/core/src/figma/core.tsusedhostname.endsWith("figma.com"), which a host likeevil-figma.comwould satisfy without actually being Figma's domain. Replaced with an exact host match plus a proper.figma.comsubdomain suffix check.actions/missing-workflow-permissions, medium):.github/workflows/test.ymlran onpull_request(including forks) without apermissionsblock, so itsGITHUB_TOKENgot the repo's default (potentially broader) permissions. Addedpermissions: contents: readat the workflow level — the job only checks out, installs, builds, and tests.Test plan
pnpm --filter @figtools/core test— 51/51 tests pass, including a new test covering theevil-figma.combypass casepnpm --filter @figtools/core build— compiles cleanlymain🤖 Generated with Claude Code