Linear API Key
Linear API Keys are credentials used to authenticate requests to the Linear API, a tool designed for project management and issue tracking. These keys allow applications and users to interact with Linear's services programmatically, enabling actions such as creating tasks, updating project statuses, and retrieving data. Exposure of these keys is a significant security concern as it can lead to unauthorized access to sensitive project information and potential manipulation of project workflows.
How Does It Look
API keys can appear in various contexts, such as:
-
Environment variables:
export LINEAR_API_KEY="lin_api_1234567890abcdef" -
Configuration files (JSON, YAML, .env):
{
"apiKey": "lin_api_1234567890abcdef"
}api_key: lin_api_1234567890abcdef -
Code snippets:
const linearApiKey = "lin_api_1234567890abcdef"; -
Connection strings (if applicable): Not typically used in connection strings.
Severity
🟠 High
This severity level is due to the potential access these keys provide to sensitive project data and the ability to modify project workflows. The blast radius includes unauthorized data access and manipulation, which can disrupt project management processes and expose confidential information.
What Can an Attacker Do?
With immediate access to a Linear API Key, an attacker can perform several actions:
- Access project data (if the credential has read permissions): Retrieve sensitive information about ongoing projects, tasks, and team activities.
- Modify project workflows (if the credential has write permissions): Change task statuses, create or delete tasks, and alter project timelines.
- Access user information (if the account has user data access enabled): View or modify user profiles and settings.
- Integrate unauthorized applications: Connect third-party applications to the Linear account, potentially leading to further data exposure.
An attacker could escalate their access by leveraging the API to gather more information about the organization, potentially leading to lateral movement within the company's systems.
Real-World Impact
The exposure of a Linear API Key poses significant business risks:
- Data Exposure: Sensitive project details and user information (if the credential has read access to sensitive data).
- Financial Loss: Potential costs associated with unauthorized project changes and the need to rectify them (if billing/resource creation is permitted).
- Operational Disruption: Project timelines and workflows could be altered, leading to delays and inefficiencies (if the attacker has delete/modify permissions).
- Reputational Damage: Loss of trust from clients and stakeholders due to unauthorized access and potential data breaches.
In a worst-case scenario, the exposure could lead to widespread disruption of project management processes and significant financial and reputational damage.
Prerequisites for Exploitation
To exploit a Linear API Key, an attacker needs:
- Network access: Ability to send requests to the Linear API endpoint.
- Additional context: Knowledge of the Linear account structure and relevant endpoints.
- No rate limits or restrictions: Exploitation is easier if there are no IP restrictions or rate limits in place.
How to Verify If It's Active
To verify if a Linear API Key is active, use the following command:
curl -H "Authorization: Bearer [API_KEY]" https://api.linear.app/graphql
Valid credential response: A successful response will return data from the Linear API, such as project or task information.
Invalid/expired credential response: An error message indicating unauthorized access or invalid credentials.
Detection Patterns
Common Variable Names:
- LINEAR_API_KEY
- LINEAR_KEY
- API_KEY
- LINEAR_TOKEN
- LINEAR_SECRET
- LINEAR_ACCESS_KEY
File Locations:
.envconfig.jsonsettings.yamlcredentials.jssecrets.env
Regex Pattern:
lin_api_[a-zA-Z0-9]{16,32}
Remediation Steps
- Revoke immediately - Go to Linear's API settings and delete the compromised API key.
- Audit access logs - Review Linear's access logs for unauthorized actions or data access during the exposure window.
- Assess blast radius - Identify all systems, applications, and environments that used the exposed credential.
- Rotate credential - Generate a new API key in Linear with least-privilege permissions.
- Update dependent systems - Deploy the new credential to all applications and update CI/CD pipelines securely.
- Harden access controls - Enable IP allowlisting in Linear and require secure connections.
- Implement secrets management - Migrate credentials to a secrets manager (HashiCorp Vault, AWS Secrets Manager) to prevent hardcoding.
- Add detection controls - Set up pre-commit hooks and repository scanning to catch credential leaks before they reach production.
Credential exposures often go undetected for extended periods, increasing the window for exploitation. As a long-term strategy, plan to establish an internal process or engage an external vendor for continuous external exposure monitoring. This helps identify leaked secrets across public repositories, paste sites, dark web forums, and other external sources before attackers can leverage them. Proactive detection and rapid response are essential to minimizing the impact of credential leaks.