Summary
Grafana OnCall through version 1.16.11 exposes an internal plugin installation API without proper authentication, allowing remote attackers to obtain a valid PluginAuthToken using hardcoded identifiers from public source code.
With this token, an attacker can access internal APIs, bootstrap arbitrary admin users, revoke legitimate plugin tokens, and redirect OnCall-to-Grafana API traffic to attacker-controlled infrastructure.
Affected context
The vulnerability arises in Grafana OnCall deployments that expose the plugin's internal HTTP endpoints over a reachable network interface.
It particularly affects instances where:
- The internal plugin install endpoint is accessible without upstream authentication or strong network isolation
- Default or hardcoded
stack_idandorg_idvalues from the public codebase remain valid in production - Internal PluginAuthToken issuance is trusted implicitly by downstream OnCall and Grafana components
In these environments, the unauthenticated endpoint effectively provides a backdoor into authenticated API operations.
Exploit preconditions
- Attack surface: Network-accessible Grafana OnCall plugin endpoints (typically HTTP/HTTPS).
- Required access: Remote network connectivity to the OnCall service; no prior authentication required.
- Trigger point: An HTTP POST request to the internal plugin install endpoint using known default
stack_idandorg_idvalues. - Why exploitation is possible: The endpoint performs privileged token issuance and configuration updates without enforcing authentication or authorization checks, treating any caller as trusted when they supply the expected static identifiers.
Why this happens
The core issue maps to CWE-306: Missing Authentication for Critical Function, where a sensitive operation is exposed without verifying the caller's identity.
In this case, the internal plugin install endpoint is designed to:
- Issue a PluginAuthToken that is accepted by internal APIs as proof of legitimacy
- Perform privileged bootstrap logic, including user-context manipulation and configuration changes
Because this endpoint:
- Does not enforce authentication
- Relies on hardcoded, publicly known
stack_idandorg_idvalues as implicit trust anchors
any remote party with network access can perform actions intended only for a trusted, authenticated plugin bootstrap process.
Architecturally, treating an internal bootstrap path as inherently trusted, while still exposing it over a general network interface, creates an authentication gap that attackers can directly exploit.
Potential impact
- Remote attackers can obtain a valid PluginAuthToken and impersonate the legitimate OnCall plugin.
- Attackers may authenticate against internal OnCall APIs and perform actions intended for trusted components.
- Creation of arbitrary admin-level users via the user-context header bootstrap path, leading to full administrative control.
- Revocation of the legitimate plugin's token, potentially causing denial of service for legitimate integrations.
- Modification of organization-level settings such as
grafana_urlandapi_token, enabling redirection of OnCall-to-Grafana API calls to attacker-controlled hosts. - Exposure or manipulation of alerting workflows, escalation policies, and incident data handled by Grafana OnCall.
- Use of the compromised OnCall instance as a pivot point for broader compromise of connected Grafana environments and downstream systems.
General mitigation guidance
Effective mitigation centers on enforcing strong authentication and minimizing implicit trust in internal control paths:
- Require explicit authentication and authorization checks on all endpoints that issue tokens, create users, or modify organization-level configuration, even if they are considered "internal" or "bootstrap" paths.
- Replace hardcoded, static identifiers (such as
stack_idandorg_iddefaults) with dynamically generated, deployment-specific values that are not guessable or publicly documented. - Restrict which identities can obtain PluginAuthTokens, tying token issuance to authenticated principals and clearly scoped roles.
- Apply least-privilege principles to plugin tokens so that a plugin-specific credential cannot arbitrarily create admin users or rewrite critical configuration without additional checks.
- Use defense-in-depth network controls (e.g., binding internal endpoints to loopback interfaces, service meshes, or private subnets) so that sensitive plugin APIs are not reachable from untrusted networks.
- Introduce explicit bootstrap phases that are one-time, time-limited, and disabled automatically after initialization, instead of leaving powerful bootstrap endpoints active indefinitely.
How teams detect issues like this
Detection efforts can focus on both code-level indicators and runtime behaviors:
- Static analysis and code review:
- Search for routes or controllers related to "install", "bootstrap", or "internal" that lack authentication middleware or explicit permission checks.
- Flag endpoints that:
- Issue tokens or session credentials
- Accept configuration changes for organization-wide settings
- Create or elevate user accounts
without verifying the caller's identity.
- Identify uses of hardcoded IDs or secrets (
stack_id,org_id) used as implicit authentication gates. - Configuration and policy enforcement:
- Enforce policies requiring authentication/authorization annotations on all routes that perform security-sensitive operations.
- Integrate automated review tools or CI checks that fail builds when new unauthenticated endpoints are added under privileged route groups.
- Runtime monitoring and logs:
- Monitor for POST requests to internal plugin install endpoints originating from unexpected IP addresses or outside normal deployment workflows.
- Alert on issuance of new PluginAuthTokens outside of known deployment and upgrade windows.
- Track creation of new admin users and changes to
grafana_urlorapi_token, correlating them with the source endpoints and authentication state.
Automated code review or security scanning tools can be configured to look for missing authentication patterns and misconfigured access controls as part of regular development pipelines.

