Secret leaks often occur when a sensitive piece of authentication data is stored with the source code of an application. Considering the source code is intended to be deployed across multiple assets, including source code repositories or application hosting servers, the secrets might get exposed to an unintended audience.

Why is this an issue?

In most cases, trust boundaries are violated when a secret is exposed in a source code repository or an uncontrolled deployment environment. Unintended people who don’t need to know the secret might get access to it. They might then be able to use it to gain unwanted access to associated services or resources.

The trust issue can be more or less severe depending on the people’s role and entitlement.

If an attacker gains access to a Figma personal access token, they might be able to compromise the data that is accessible to the linked Figma account. By doing so, it might be possible for confidential data to be leaked by the attacker.

What is the potential impact?

Below are some real-world scenarios that may occur when a malicious entity manages to retrieve a leaked Figma personal access token.

Compromise of business-critical data

An attacker can use a personal access token to gain unauthorized access to your company’s Figma projects and designs. This can include confidential client data, proprietary design assets, or any other intellectual property stored in Figma. With unauthorized access, the attacker can download and share this sensitive data, potentially leading to data breaches, intellectual property theft, or other forms of unauthorized disclosure.

Unauthorized actions in Figma environment

With a leaked Figma personal access token, an attacker can perform various actions on behalf of your company within the Figma workspace. This can include creating, modifying, or deleting projects, files, or team members. By impersonating authorized users, the attacker can manipulate your company’s design assets or disrupt the design workflow. This can result in unauthorized changes and data loss.

How to fix it

Revoke the secret

Revoke any leaked secrets and remove them from the application source code.

Before revoking the secret, ensure that no other applications or processes are using it. Other usages of the secret will also be impacted when the secret is revoked.

Use a secret vault

A secret vault should be used to generate and store the new secret. This will ensure the secret’s security and prevent any further unexpected disclosure.

Depending on the development platform and the leaked secret type, multiple solutions are currently available.

Code examples

Noncompliant code example

import requests

token = 'figd_OLDXZWOP4fxW4c9ER0xzxRda96M-f0eFwZpFQjHJ'  # Noncompliant
response = requests.get('https://api.figma.com/v1/me', headers={
    'X-FIGMA-TOKEN': token,
    'Content-Type': 'application/json'
})

Compliant solution

import requests

token = os.getenv('FIGMA_PERSONAL_ACCESS_TOKEN')
response = requests.get('https://api.figma.com/v1/me', headers={
    'X-FIGMA-TOKEN': token,
    'Content-Type': 'application/json'
})

Resources

Documentation

Figma Developers - Access tokens

Standards