CVE-2026-139967 PUBLISHED

Plaintext API keys stored in AshAuthentication audit log entries

Assigner: EEF
Reserved: 30.11.2026 Published: 04.12.2026 Updated: 04.12.2026

Insertion of Sensitive Information into Log File vulnerability in team-alembic ash_authentication allows a reader of the audit log to sign in as any user who has signed in with an API key.

The audit_log add-on records every public argument of an audited action that is not marked sensitive?. The API key sign-in action written by mix ash_authentication.add_strategy.api_key, the API keys guide and the usage rules declares api_key without sensitive?, and nothing required it, so every API key sign-in, including each request AshAuthentication.Strategy.ApiKey.Plug authenticates, stored the plaintext key in the entry's extra_data. The application keeps only key hashes, but anyone who can read the audit table, its backups or an admin view of it obtains working keys. Magic link and confirmation tokens, one-time passwords, and TOTP and recovery codes were stored the same way when the action did not mark them sensitive.

This issue affects ash_authentication: from 4.12.0 before 4.15.2 and from 5.0.0-rc.0 before 5.0.0-rc.19.

Metrics

CVSS Vector: CVSS:4.0/AV:L/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
CVSS Score: 6.7

Product Status

Vendor team-alembic
Product ash_authentication
Versions Default: unaffected
  • affected from 4.12.0 to 4.15.2 (excl.)
  • affected from 5.0.0-rc.0 to 5.0.0-rc.19 (excl.)
Vendor team-alembic
Product ash_authentication
Versions Default: unaffected
  • affected from 255cfc9c0e511b7e0de39f8b3d676ae994fae06c to * (excl.)

Affected Configurations

The audit_log add-on is enabled and the api_key strategy's sign-in action does not mark its api_key argument sensitive?: true, which is how the generator, the API keys guide and the usage rules write it. The other secrets are exposed only when the action the application defines for them omits sensitive?. Fields named in include_fields are logged by design.

Workarounds

Mark the api_key argument of the API key sign-in action sensitive?: true, and do the same for any secret argument of a magic link, OTP, TOTP, recovery code or confirmation action the application defines. Alternatively, add the sign-in action to the audit log's exclude_actions. Neither removes keys already logged; see the solution.

Solutions

Upgrade to 4.15.2 or 5.0.0-rc.19. The audit log then never records a strategy's secret arguments unless include_fields names them, and an API key sign-in action whose argument is not sensitive compiles with a warning.

Upgrading does not remove keys already logged. Treat every API key used while the add-on was enabled as exposed and revoke it; the middle segment of each key encodes the id of its API key record. Remove the keys from existing entries, for example on PostgreSQL with UPDATE <audit_log_table> SET extra_data = extra_data #- '{params,api_key}' WHERE extra_data->'params' ? 'api_key';, and account for backups, replicas and exports of the audit table.

Credits

  • Glenn Rempe reporter
  • Zach Daniel coordinator
  • Glenn Rempe remediation developer
  • Zach Daniel remediation reviewer

References

Problem Types

  • CWE-532 Insertion of Sensitive Information into Log File CWE

Impacts

  • A reader of the audit store takes a logged API key and signs in as its user through the API key strategy, with that user's permissions, until the key is revoked.