Add Figma Personal Access Token v3 Detector#4790
Open
shahzadhaider1 wants to merge 5 commits intotrufflesecurity:mainfrom
Open
Add Figma Personal Access Token v3 Detector#4790shahzadhaider1 wants to merge 5 commits intotrufflesecurity:mainfrom
shahzadhaider1 wants to merge 5 commits intotrufflesecurity:mainfrom
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
pkg/detectors/figmapersonalaccesstoken/v3/figmapersonalaccesstoken_integration_test.go
Show resolved
Hide resolved
pkg/detectors/figmapersonalaccesstoken/v3/figmapersonalaccesstoken_integration_test.go
Outdated
Show resolved
Hide resolved
pkg/detectors/figmapersonalaccesstoken/v3/figmapersonalaccesstoken.go
Outdated
Show resolved
Hide resolved
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
Adds a v3 detector for Figma Personal Access Tokens to support the new
figp_prefixed token format. Also refactors the shared verification logic across all three detector versions to eliminate code duplication.Changes
New v3 detector (
figp_prefix)figp_[a-zA-Z0-9_=-]{40,54}as specified by Figmafigp_for efficient chunk matching\b) assertions used since the token character set includes non-word characters (=,-) which are incompatible with\bVerification logic refactored into shared
VerifyMatchfunctionVerifyMatchfunction in the v1 packagev1.VerifyMatchinstead of duplicating the HTTP verification inlineVerification details
GET https://api.figma.com/v1/mewithX-Figma-TokenheaderTesting
figp_token format is not yet available for generation in Figma. Tests will be unskipped once v3 secrets are provisioned in GCP.Checklist:
make test-community)?make lintthis requires golangci-lint)?Note
Medium Risk
Adds a new Figma token pattern and registers it in the default detector list, increasing scan surface and potential false positives/negatives. Refactors verification for v1/v2 to a shared
VerifyMatchhelper (including response-body draining), which could subtly change verification behavior and error handling across versions.Overview
Adds a new v3 Figma Personal Access Token detector to match the
figp_token format (new regex/keyword) and wires it into the default detector set.Refactors v1 verification into an exported
VerifyMatchhelper (with explicit response-body draining/closing) and updates v2/v3 to reuse it; integration tests are updated accordingly and v3 adds new unit + (skipped) integration tests.Written by Cursor Bugbot for commit 10f52aa. This will update automatically on new commits. Configure here.