Details
GET /api/debug/pprof/heap?debug=1 HTTP/1.1
Host: arcane.example.com
Authorization: Bearer <NON_ADMIN_ACCESS_TOKEN>
The expected result is:
HTTP/1.1 403 Forbidden
with an authorization error indicating that the user does not have permission to access the resource.
This contrast demonstrates the authorization inconsistency:
environment-scoped token
-> admin gate skipped
-> pprof handler reached
normal non-admin user
-> admin gate evaluated
-> HTTP 403
Expected secure behavior
A valid environment access token should receive:
HTTP/1.1 403 Forbidden
for every route protected with WithAdminRequired().
Only a caller whose effective permission set satisfies IsGlobalAdmin() should be allowed to access these routes.
Impact
An attacker who obtains a valid environment access token can cross the intended authorization boundary between an individual environment and manager-wide administrative functionality.
In the currently identified route configuration, this allows unauthorized access to the manager's Go pprof diagnostic endpoints.
Depending on the requested profile, these endpoints can expose internal runtime and diagnostic information such as:
- goroutine stack traces;
- function and package names;
- allocation and heap profiling information;
- CPU profiling information;
- runtime execution traces;
- process command-line information;
- mutex, block, thread and allocation profiling data.
This information is normally restricted to global administrators by Arcane's explicit use of WithAdminRequired().
Some profiling operations may also impose additional CPU, memory, or tracing overhead while being collected.
Importantly, this report does not assume that Go's pprof heap endpoint is an arbitrary raw-process-memory dump. Direct extraction of session tokens, environment access tokens, passwords, or other credentials from pprof output has not been demonstrated and is therefore not claimed as part of the confirmed impact.
The confirmed security issue is the authorization bypass itself and the resulting unauthorized exposure of administrator-restricted diagnostic functionality.
Root Cause
The root cause is that authentication through an environment access token takes an early-success path:
environmentScopedInternal(c, env)
return next(c)
before common middleware authorization options are evaluated.
As a result, authorization requirements configured on the middleware are dependent on which authentication mechanism is used.
Authentication establishes the identity and scope of the caller, but route-level authorization requirements such as AdminRequired should subsequently be applied consistently regardless of the authentication mechanism.
Remediation
The environment-token authentication path should not call next(c) before the configured authorization requirements have been evaluated.
One approach is to resolve the environment token into its EnvironmentPermissionSet and then pass that permission set through the same authorization-option evaluation used by other authentication mechanisms.
For example, logically:
if envTokenIsValid {
ps := authz.EnvironmentPermissionSet(env.ID)
if m.options.AdminRequired && !ps.IsGlobalAdmin() {
return forbidden
}
environmentScopedInternal(c, env)
return next(c)
}
Because an EnvironmentPermissionSet intentionally has no global permissions, an environment token would then correctly receive HTTP 403 for WithAdminRequired() routes.
As additional defense in depth, the pprof endpoints could explicitly reject environment access tokens and other environment-scoped authentication mechanisms, allowing access only through authentication mechanisms capable of representing a global administrator.
It may also be worth considering whether pprof should be exposed in production by default or enabled only through an explicit diagnostic configuration option.
Regression Tests
The following cases should be covered:
Valid environment access token
+ /api/debug/pprof/heap
=> 403
Normal authenticated non-admin user
+ /api/debug/pprof/hea
=> 403
Unauthenticated request
+ /api/debug/pprof/heap
=> 401/403
Global administrator
+ /api/debug/pprof/heap
=> 200
More generally, tests should verify that every authentication mechanism is subject to middleware options such as AdminRequired.
The issue could also broadly be categorized as an authorization-check bypass caused by inconsistent authorization handling across authentication paths..
No claim of credential extraction, arbitrary process-memory disclosure, or global-administrator takeover is made unless separately demonstrated through dynamic testing.