Environment API Key Can Read Decrypted Integration Credentials
Description
Environment API Key Can Read Decrypted Integration Credentials
Executive Summary
Novu exposes GET /v1/integrations and GET /v1/integrations/active through @ExternalApiAccessible(). When the caller authenticates with an environment API key, the auth layer grants ALL_PERMISSIONS, which makes the integrations controller set returnCredentials=true.
The downstream listing flow then decrypts and returns each integration's stored credentials object in clear form.
I verified this end to end: after creating a Mailgun integration with known credentials, I used only the environment API key to call both list endpoints, and the API returned the exact cleartext apiKey, secretKey, and domain.
This is a real provider credential leakage issue. The API key caller gains direct access to the stored secrets Novu uses to authenticate to third-party providers.
Vulnerability Classification
- Category: broken access control / secret disclosure
- Boundary crossed:
- environment API key caller to integration credential material
- runtime/event API secret to provider administration secret
- Primary impacts:
- confidentiality
- integrity
Security Expectation
An environment API key should not be able to retrieve decrypted integration credentials unless that behavior is explicitly intended and scoped as provider-secret administration capability.
More concretely:
- API-key callers should not receive cleartext
credentialsfrom integration listing routes - routes intended for general external API use should not double as secret export endpoints
- provider credential visibility should remain separated from environment API key runtime access
Affected Functionality
Verified vulnerable endpoints:
GET /v1/integrationsGET /v1/integrations/active
Relevant code areas:
apps/api/src/app/integrations/integrations.controller.tsapps/api/src/app/integrations/usecases/get-integrations/get-integrations.usecase.tslibs/application-generic/src/usecases/get-active-integration/get-active-integration.usecase.tslibs/application-generic/src/usecases/get-decrypted-integrations/get-decrypted-integrations.usecase.tsapps/api/src/app/auth/services/community.auth.service.ts
Verified proof file:
apps/api/src/app/integrations/e2e/api-key-integration-credential-leak.e2e.ts
Root Cause Summary
The issue comes from combining three behaviors:
- integration list routes are marked
@ExternalApiAccessible() - API-key authentication returns a
UserSessionDataobject withALL_PERMISSIONS - integration listing passes
returnCredentials=true, causing the usecase to decrypt and returnintegration.credentials
That means an environment API key is treated like a privileged operator for integration read routes, and the response includes cleartext provider secrets with no redaction.