Skip to content

OAuth2 Client Secret leakage in logs when configuring with environment variables

Moderate
diced published GHSA-2h25-m8rf-v86j Jun 3, 2026

Package

npm zipline (npm)

Affected versions

>=4.2.0

Patched versions

4.6.2

Description

Summary

Zipline allows configuration via environment variables, such as OAUTH_OIDC_CLIENT_SECRET= and OAUTH_OIDC_CLIENT_SECRET_FILE=. The server logs, on startup, the contents of sensitive data like client secrets without redaction, resulting in a leakage in logging facilities (e.g. system journal, docker logs, etc.)

Details

The code that logs the environment variables (envvar) is as below:

for (const [propPath, val] of Object.entries(dbEnv)) {
const col = Object.entries(DATABASE_TO_PROP).find(([_colName, path]) => path === propPath)?.[0];
if (col) {
database[col] = val;
if (!global.__tamperedConfig__) {
global.__tamperedConfig__ = [];
}
global.__tamperedConfig__.push(col);
logger.info('overriding database value from env', { col, value: val });
}
}

The code logs the name and value of every envvar that corresponds to/overrides a database property. (As such, this does not apply to CORE_SECRET.)

No attempt at masking the contents of certain sensitive envvars is made, causing credentials to be leaked to the logs.

PoC

Assuming a Docker setup, the following steps are needed. However, the general procedure apply to something like NixOS.

  1. Insert credentials in .env and a secret file:
$ cat >> .env <<EOF
OAUTH_OIDC_AUTHORIZE_URL=https://op.invalid/auth
OAUTH_OIDC_TOKEN_URL=https://op.invalid/oidc/token
OAUTH_OIDC_USERINFO_URL=https://op.invalid/oidc/userinfo
OAUTH_OIDC_CLIENT_ID=$(uuidgen)
OAUTH_OIDC_CLIENT_SECRET=$(openssl rand -base64 32)
OAUTH_DISCORD_CLIENT_ID=anything
OAUTH_DISCORD_CLIENT_SECRET_FILE=/run/secrets/discord_csecret
EOF

$ echo "from_discord_token_file" > discord_csecret
  1. Configure Docker to load the secret:
services:
  zipline:
    secrets:
    - discord_csecret

secrets:
  discord_csecret:
    file: discord_csecret
  1. Observe the logs:
[2026-05-30T17:45:19 INFO   server] starting zipline mode="production" version="4.6.1" argv=[]
[2026-05-30T17:45:19 INFO   server] reading settings...
[2026-05-30T17:45:19 INFO   config::read] overriding database value from env col="oauthDiscordClientId" value="anything"
[2026-05-30T17:45:19 INFO   config::read] overriding database value from env col="oauthDiscordClientSecret" value="from_discord_token_file"
[2026-05-30T17:45:19 INFO   config::read] overriding database value from env col="oauthOidcClientId" value="18329f69-64c7-4536-8116-453869fa9b64"
[2026-05-30T17:45:19 INFO   config::read] overriding database value from env col="oauthOidcClientSecret" value="BQUWGM2xS+UFga19Ar5JQVtQCG+7306NXJiC8IRPEuQ="
...

Impact

An attacker with access to the logs may be able to intercept an OAuth2 callback and exchange a valid token with the client secret. Through the use of PKCE in versions >=4.6.0, this may be mitigated.

If there are other secrets available to be configured via environment variables, they will still be subject to this vulnerability.

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
High
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N

CVE ID

No known CVE

Weaknesses

Insertion of Sensitive Information into Log File

The product writes sensitive information to a log file. Learn more on MITRE.

Credits