Riot Games API Key
Riot Games API Keys are used to authenticate requests to the Riot Games API, which provides access to various game data and services, including player statistics, match history, and game metadata. These keys are essential for developers building applications that interact with Riot Games' services. Exposure of these keys can lead to unauthorized access to sensitive game data and potentially abusive actions against the API, impacting both the developer's application and the Riot Games infrastructure.
How Does It Look
Riot Games API Keys can appear in various contexts, such as:
-
Environment variables:
export RIOT_API_KEY="RGAPI-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -
Configuration files (JSON):
{
"riotApiKey": "RGAPI-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
} -
Code snippets:
api_key = "RGAPI-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -
Connection strings (if applicable): Not typically used in connection strings.
Severity
🟠 High
The severity is high because the API key provides access to a wide range of game data and services. If exposed, an attacker could misuse the API, leading to data breaches or service disruptions. The blast radius includes unauthorized data access and potential API abuse, which could result in account suspension or throttling by Riot Games.
What Can an Attacker Do?
With immediate access to a Riot Games API Key, an attacker can perform several actions:
- Access player data (if the key has permissions to retrieve player statistics and match history)
- Abuse API rate limits (if the key is used to make excessive requests, leading to throttling or suspension)
- Extract game metadata (if the key allows access to game-related information)
- Potentially disrupt services (if the key is used in a way that violates Riot Games' terms of service)
An attacker could escalate their access by combining the API key with other exposed credentials or exploiting vulnerabilities in the application using the key. This could lead to further unauthorized access or lateral movement within the developer's infrastructure.
Real-World Impact
The exposure of a Riot Games API Key poses significant business risks:
- Data Exposure: Player statistics and match history (if the credential has read access to sensitive data)
- Financial Loss: Potential fines or penalties from Riot Games for API abuse (if billing/resource creation is permitted)
- Operational Disruption: Application downtime or degraded performance (if the attacker has delete/modify permissions)
- Reputational Damage: Loss of trust among users and partners
In the worst-case scenario, the exposure could lead to cascading effects, such as widespread data breaches or significant financial penalties, severely impacting the developer's business operations.
Prerequisites for Exploitation
To exploit an exposed Riot Games API Key, an attacker needs:
- Network access to the application or service using the API key
- Knowledge of API endpoints to make valid requests
- No rate limits or restrictions that prevent excessive use
How to Verify If It's Active
To verify if a Riot Games API Key is active, use the following command:
curl -X GET "https://api.riotgames.com/lol/summoner/v4/summoners/by-name/[SUMMONER_NAME]?api_key=[API_KEY]"
Valid credential response: A successful response will return JSON data with the summoner's information.
Invalid/expired credential response: An error message indicating the key is invalid or expired.
Detection Patterns
Common Variable Names:
- RIOT_API_KEY
- riotApiKey
- apiKey
- RGAPI_KEY
- riot_key
- riotApi
File Locations:
.envconfig.jsonsettings.yamlapp/config.pysrc/config.js
Regex Pattern:
RGAPI-[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}
Remediation Steps
- Revoke immediately - Go to the Riot Games Developer Portal and delete the compromised API key.
- Audit access logs - Review API access logs for unauthorized requests or unusual activity 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 the Riot Games Developer Portal with least-privilege permissions.
- Update dependent systems - Deploy the new credential to all applications and update CI/CD pipelines securely.
- Harden access controls - Implement IP allowlisting and rate limiting in the Riot Games Developer Portal.
- 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.