Summary
Stirling-PDF exposes an internal backend API key to authenticated users with the ROLE_USER permission through its user API-key functionality. A user who obtains the key may impersonate the internal service account, bypass ordinary rate limits, and access internal information endpoints.
Affected context
The issue occurs in Stirling-PDF deployments using the pipeline processing endpoint before the relevant security correction. Pipeline subrequests receive the STIRLING-PDF-BACKEND-API-USER credential, while an authenticated regular user can retrieve that credential through the API-key endpoint. The risk is greater when internal endpoints rely on the service-account key for authorization rather than independently enforcing the caller's privileges.
Exploit preconditions
- Attack surface: Authenticated Stirling-PDF web and API endpoints
- Required access: A valid account with the
ROLE_USERpermission - Trigger point: Access to the user API-key functionality followed by requests using the exposed backend credential
- Why exploitation is possible: A credential intended for internal service-to-service requests is disclosed to a lower-privileged user and can be reused to authenticate against internal endpoints
Why this happens
The underlying issue is an authorization and secret-disclosure design flaw. A backend API key used by pipeline subrequests is exposed through a user-accessible API path, allowing a normal authenticated user to obtain a credential with broader trust than the user's own session.
This maps primarily to CWE-200: Exposure of Sensitive Information to an Unauthorized Actor. It is also related to CWE-522: Insufficiently Protected Credentials, because a service credential is made available beyond its intended trust boundary.
Potential impact
- An authenticated user may impersonate the internal backend service account
- Attackers could bypass endpoint-specific rate limits
- Unauthorized users may access internal request or load information
- Sensitive operational metadata could be disclosed
- The exposed credential could support broader abuse if additional trusted endpoints accept it
General mitigation guidance
Mitigation generally focuses on separating internal service credentials from user-accessible API functionality and enforcing authorization at every endpoint.
Common defensive patterns include:
- Never returning internal service-account keys through user-facing API responses
- Using short-lived, narrowly scoped credentials for service-to-service communication
- Enforcing authorization based on the originating user's privileges rather than trusting a shared backend key alone
- Applying independent rate limits and access checks to internal and administrative endpoints
- Storing secrets outside application responses and protecting them with least-privilege access controls
- Rotating credentials after possible disclosure and invalidating unnecessary shared keys
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis and code review checks for secrets passed into user-facing responses
- Tracing whether internal API credentials are injected into requests derived from user input or sessions
- Testing authorization boundaries between regular users, service accounts, and administrative endpoints
- Monitoring for the same API key being used across unrelated users or from unexpected request paths
- Policy checks that prohibit hard-coded or broadly scoped credentials in browser-accessible API contracts
- Automated API security testing for privilege escalation, credential exposure, and rate-limit bypass behavior

