Background
Perses is an open-source dashboard application for observability data, a project of the Cloud Native Computing Foundation (CNCF). Teams use it to build dashboards over metrics, logs, traces and profiles from systems such as Prometheus, Tempo, Loki and Pyroscope, and the dashboards can be managed as code. It has its own user accounts and role-based access control.
Dashboards do not store the monitoring data. They fetch it from external datasources. To avoid giving the browser direct access (and the credentials) for each backend, Perses has a datasource proxy. The browser sends a query to the Perses server, the server forwards it to the datasource, and the response is returned. Whoever configures a datasource can store credentials for it, and the proxy adds them to the outgoing request.
Terms used below:
- JWT cookies are how a signed-in Perses user is identified. The login sets cookies holding a signed token. A short-lived access token authorizes requests, and a longer-lived refresh token can be traded for new access tokens.
- Backend is the datasource server that receives the proxied query.
- Account takeover is when an attacker obtains a working session as the victim.
Summary
The datasource proxy forwards the dashboard user’s own Perses credentials to the backend receiving a query. Under JWT cookie authentication, that includes the refresh token. A party controlling or observing the backend can replay this token to create a working session for the victim.
The browser sends cookies to Perses because the query starts on the Perses origin. The proxy crosses a second boundary when it constructs the backend request. Copying those cookies exposes application credentials to a destination that only needs the query and its separately configured datasource credentials. Normal dashboard use is enough to trigger the leak.
How the Vulnerability Works
When one server forwards a request on behalf of a user, it crosses two trust boundaries. The browser trusts Perses with its login cookies, because Perses issued them. The datasource backend is a different party, and it should only receive what it needs to answer the query, which is the query itself and the credentials configured for that datasource.
Perses’ proxy does not make that distinction. It starts the outgoing request by copying the incoming request’s headers. Then it applies the datasource’s allow and drop lists, which are empty by default. The result is that the user’s Cookie header goes to the backend unchanged:
Browser -> Perses: Cookie: jwtPayload=...; jwtSignature=...; jwtRefreshToken=...
Perses -> Backend: Cookie: jwtPayload=...; jwtSignature=...; jwtRefreshToken=... <- should not be forwardedWhere a datasource has stored credentials, Perses replaces the Authorization header but still leaves the cookies in place. And for a datasource without credentials, the user’s own bearer token can pass through too.
Why this matters depends on what the cookie contains. The refresh token is not just an identifier. Sending it to Perses’ POST /api/auth/refresh endpoint produces a fresh access token for that user. Anyone who sees the cookie in a forwarded request, for example the operator of a compromised or malicious backend, or anyone who can observe that traffic, can use it to log in as the victim. No exploit is needed beyond a victim opening a dashboard that queries that backend.
The user never intended to hand their Perses login to the datasource, and the datasource has no need for it. The fix is to strip Perses’ own authentication from proxied requests, so that only datasource-specific credentials leave the server.
Prerequisites
Authentication must be enabled and a victim must trigger a proxied datasource request while signed in. The attacker needs control of, or visibility into, the receiving backend. Someone permitted to configure datasources may be able to choose that destination. An already compromised backend can expose the same problem without a new datasource being created.
The backend does not need permission to log in as the victim. It receives a reusable credential in the forwarded request. The takeover test used JWT cookies and an attacker-controlled local listener.
Attack Path
- STARTAttacker controls a datasource backend
- STEP 01Victim loads a dashboard query
The browser sends its Perses cookies to the same-origin proxy.
- STEP 02Proxy copies session headers to the backend
MITIGATION Strip application credentials before forwarding
- STEP 03Backend captures the refresh token
- STEP 04Replay the token to obtain a victim session
MITIGATION Keep refresh credentials within the authentication boundary
Root Cause
httpProxy.prepareRequest starts by copying incoming headers. filterHeaders only applies the datasource’s configured allow and drop lists, which are empty by default. That leaves the caller’s Cookie header intact.
setupAuthentication can replace the outbound Authorization header when a datasource defines credentials or explicitly enables OAuth passthrough. It does not remove the Perses cookies. With a secretless datasource, a caller’s bearer token can also remain in the outgoing request.
The exposed JWT cookies include jwtPayload, jwtSignature and jwtRefreshToken. Submitting the captured refresh token to POST /api/auth/refresh issues a new access token. The value leaked to the backend is therefore usable for account takeover, not just an identifier. The proxy must distinguish authentication to Perses from authentication to a datasource.
Validation
The proof of concept tested revision 2e532451 (shortly after v0.55.0-beta.3) with authentication enabled, two projects, test users and a local echo backend. It captured the outbound request and exercised the refresh endpoint with the leaked credential.
| Check | Intended boundary | Recorded result |
|---|---|---|
| Proxy request without session cookies | Reject unauthenticated use | HTTP 401 |
| Signed-in datasource query | Keep Perses credentials local | Backend received session cookies |
| Replay captured refresh token | Backend cannot acquire a user session | New access token for the victim |
The refresh response established that the leaked value was usable. Cookie names appearing in a backend log alone would not prove takeover. The recorded chain was repeated from clean state and through the packaged proof of concept.
Impact
A malicious datasource can acquire the sessions of users whose dashboards query it, including read-only viewers. The resulting access is that of the victim account and can cross the attacker’s original project or role restrictions. If the victim is an administrator, the attacker gains administrator access to the Perses instance.
Exposure depends on the caller’s authentication method and the headers reaching the proxy. The reported chain demonstrated Perses refresh-token replay. When present, the oidcToken and oidcRefreshToken cookies are forwarded too, which exposes the identity provider’s tokens as well. The takeover proof itself used the Perses refresh mechanism.
Remediation
Upgrade to 0.55.0 or later, the fixed release identified by the published advisory. Outbound proxy requests must remove Perses credentials before applying the datasource’s own authentication settings.
While preparing an upgrade, limit who can create or update datasources to fully trusted users, and audit header policies and prevent application cookies and unintended bearer credentials from reaching datasource backends. Treat backend logs as possible credential exposure if they recorded these requests. If exposure is suspected, the advisory recommends rotating the JWT signing key (security.encryption_key) to invalidate all existing sessions and refresh tokens. Test the correction with an echo datasource: queries should still work while session cookies stay absent and explicit datasource credentials retain their intended behavior.