GHSA-rwrp-9823-p2xq Flowise: Incomplete Credential Redaction Exposes Secrets via API
SummaryThe `GET /api/v1/credentials/:id` endpoint decrypts stored credential data and returns it in the `plainDataObj` field of the API response. While a `redactCredentialWithPasswordType()` function masks fields defined with `type: 'password'` in their component schema, many credential types store highly sensitive data (database connection URLs with embedded passwords, Google service account JSON with RSA private keys, AWS access keys) in fields defined as `type: 'string'`. These string-type fields are returned in **full plaintext** without any redaction.Any authenticated user with `credentials:view` permission can retrieve the raw secrets of any credential in their workspace by calling this endpoint.Vulnerable CodeService Layer**`packages/server/src/services/credentials/index.ts`**, `getCredentialById()` (line 127):At line 138, the credential's encrypted data is decrypted:At lines 143-146, the decrypted data is attached to the response as `plainDataObj`:At line 147, only `encryptedData` is stripped, leaving `plainDataObj` intact:Incomplete Redaction**`packages/server/src/utils/index.ts`**, `redactCredentialWithPasswordType()` (line 1697):This function **only** redacts fields where `inp.type === 'password'`. Fields with `type: 'string'` are returned verbatim, even when they contain secrets.Credential Definitions Storing Secrets in String-Type Fields| Credential | Field | Type | Contains |
|---|---|---|---|
| `mongoDBUrlApi` | `mongoDBConnectUrl` | `string` | `mongodb+srv://user:password@host/db` |
| `googleVertexAuth` | `googleApplicationCredential` | `string` | Full service account JSON with RSA private key |
| `postgresUrl` | `postgresUrl` | `string` | `postgresql://user:password@host/db` |
| `redisCacheUrlApi` | `redisUrl` | `string` | `redis://user:password@host:port` |
| `awsApi` | `awsKey` | `string` | AWS Access Key ID |
| `langfuseApi` | `langFusePublicKey` | `string` | Langfuse API public key |
| `httpBasicAuth` | `basicAuthUsername` | `string` | HTTP Basic Auth username |There are 60+ credential definitions in `packages/components/credentials/`, many with sensitive string-type fields.Proof of ConceptEnvironmentFlowise v3.0.13 (`flowiseai/flowise:latest` Docker image)Authenticated as admin user via enterprise authSteps to ReproduceStart Flowise and log in as any user with `credentials:view` permission.Create a MongoDB credential with a connection URL containing embedded credentials:Retrieve the credential by ID:Observed ResultThe API returns the MongoDB connection URL in **full plaintext**, including the embedded password:The same test with a Google Vertex Auth credential returned the **complete service account JSON including the RSA private key** in plaintext:For comparison, an OpenAI API key (where the field is typed as `password`) was **correctly redacted**:This confirms the redaction is only applied to `password`-type fields, leaving `string`-type fields fully exposed.Impact**Database credential theft**: MongoDB, PostgreSQL, Redis, MySQL connection URLs with embedded passwords are returned in full plaintext. An attacker can use these to directly access production databases.**Cloud service account compromise**: Google service account JSON with RSA private keys is returned in plaintext, enabling full impersonation of the service account across Google Cloud.**AWS key exposure**: AWS Access Key IDs stored in `string`-type fields are exposed, enabling enumeration of active AWS credentials.**Lateral movement**: Stolen credentials enable pivoting from the Flowise instance to connected cloud services, databases, and APIs.**Multi-user workspace risk**: In multi-user deployments, any user with `credentials:view` permission can harvest all workspace credentials via the API.RemediationApply `redactCredentialWithPasswordType()` to **all** sensitive credential fields, not just those typed as `password`. Any field containing secrets (connection strings, JSON credentials, access keys) should be redacted.Consider never returning `plainDataObj` in API responses. The UI should use masked previews (e.g., `mongodb+srv://admin:****@cluster0...`) instead of full values.Re-type sensitive credential fields from `string` to `password` in component credential definitions to ensure they are covered by the existing redaction logic.Add a separate `secret: true` flag to credential field definitions to explicitly mark sensitive fields regardless of their input type.
CVSS v3.1 score: 6.5