CVE-2026-139967: Plaintext API keys stored in AshAuthentication audit log entries

Published Dec 4, 2026
·
Updated

Summary

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

The auditlog add-on records every public argument of an audited action that is not marked sensitive?. The API key sign-in action written by mix ashauthentication.addstrategy.apikey, the API keys guide and the usage rules declares apikey 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 extradata. 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 ashauthentication: from 4.12.0 before 4.15.2 and from 5.0.0-rc.0 before 5.0.0-rc.19.

Impact

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.

Workarounds

Mark the apikey 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 excludeactions. Neither removes keys already logged; see the solution.

Configurations

The auditlog add-on is enabled and the apikey strategy's sign-in action does not mark its apikey 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 includefields are logged by design.

Solutions

Upgrade to 4.15.2 or 5.0.0-rc.19. The audit log then never records a strategy's secret arguments unless includefields 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 <auditlogtable> SET extradata = extradata #- '{params,apikey}' WHERE extradata->'params' ? 'apikey';, and account for backups, replicas and exports of the audit table.

Other sources

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

The auditlog add-on records every public argument of an audited action that is not marked sensitive?. The API key sign-in action written by mix ashauthentication.addstrategy.apikey, the API keys guide and the usage rules declares apikey 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 extradata. 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 ashauthentication: from 4.12.0 before 4.15.2 and from 5.0.0-rc.0 before 5.0.0-rc.19.

— MITRE

Affected Software

3 affected componentsFixes available
hex/ash_authentication>=4.12.0<4.15.2, >=5.0.0-rc.0<5.0.0-rc.19
erlang/ash_authentication>=4.12.0<4.15.2
4.15.2
erlang/ash_authentication>=5.0.0-rc.0<5.0.0-rc.19
5.0.0-rc.19

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade erlang/ash_authentication to a version that resolves this vulnerability.

    Fixed in 4.15.2
  2. Upgrade

    Upgrade erlang/ash_authentication to a version that resolves this vulnerability.

    Fixed in 5.0.0-rc.19
  3. Upgrade

    Upgrade ash_authentication to a version that resolves this vulnerability.

    Fixed in 4.15.2
  4. Upgrade

    Upgrade ash_authentication to a version that resolves this vulnerability.

    Fixed in 5.0.0-rc.19
  5. Configuration

    Mark the api_key argument of the API key sign-in action sensitive?: true, and do the same for secret arguments in application-defined magic-link, OTP, TOTP, recovery-code, and confirmation actions. Do not name these secrets in include_fields, which causes them to be logged.

    AshAuthentication audit_log actions sensitive? = true
  6. Operational

    Revoke every API key used while the audit_log add-on was enabled; treat those keys as exposed. The middle segment of each key identifies its API key record.

  7. Operational

    Remove plaintext API keys from existing audit-log entries, and account for copies in audit-table backups, replicas, and exports.

Event History

Dec 4, 2026
CVE Published
via MITRE·06:38 AM
Data Sourced
via MITRE·06:38 AM
RemedyDescriptionWeakness
Data Sourced
via OSV·06:38 AM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Who can exploit the exposed credentials?

Anyone able to read the audit table, its backups, or an administrative view containing audit entries can obtain plaintext API keys and use them to sign in as the associated users. The same exposure can apply to magic-link and confirmation tokens, one-time passwords, and TOTP or recovery codes when their actions did not mark those arguments as sensitive.

2

Are API-key-authenticated requests affected by default?

Yes, the API key sign-in action generated by mix ash_authentication.add_strategy.api_key did not declare api_key as sensitive, and the audit_log add-on recorded public arguments not marked sensitive. This includes requests authenticated by AshAuthentication.Strategy.ApiKey.Plug.

3

Which versions need remediation?

Affected versions are ash_authentication 4.12.0 through versions before 4.15.2, and 5.0.0-rc.0 through versions before 5.0.0-rc.19. Upgrade to 4.15.2 or later in the 4.x line, or 5.0.0-rc.19 or later in the 5.0 release-candidate line.

4

How can an organization determine whether credentials may already have been exposed?

Review audit-log entries, related backups, and administrative audit-log views for API key sign-in actions and for authentication actions handling magic links, confirmation tokens, one-time passwords, TOTP codes, or recovery codes. Entries whose relevant arguments were not marked sensitive may contain the plaintext values in extra_data.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203