{"id":"EEF-CVE-2026-139967","summary":"Plaintext API keys stored in AshAuthentication audit log entries","details":"## Summary\n\nInsertion 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.\n\nThe `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.\n\nThis 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.\n\n## Impact\n\nA 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.\n\n## Workarounds\n\nMark 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.\n\n## Configurations\n\nThe `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.\n\n## Solutions\n\nUpgrade 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.\n\nUpgrading 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 \u003caudit_log_table\u003e SET extra_data = extra_data #- '{params,api_key}' WHERE extra_data-\u003e'params' ? 'api_key';`, and account for backups, replicas and exports of the audit table.","aliases":["CVE-2026-139967","GHSA-m7jx-358r-4v58"],"modified":"2026-12-04T06:56:17.186364388Z","published":"2026-12-04T06:38:22.809Z","database_specific":{"$schema":"https://cna.erlef.org/schemas/osv/record-0.1.0.json","capec_ids":["CAPEC-560"],"cpe_ids":["cpe:2.3:a:team-alembic:ash_authentication:*:*:*:*:*:*:*:*"],"cwe_ids":["CWE-532"]},"references":[{"type":"ADVISORY","url":"https://github.com/team-alembic/ash_authentication/security/advisories/GHSA-m7jx-358r-4v58"},{"type":"WEB","url":"https://cna.erlef.org/cves/CVE-2026-139967.html"},{"type":"WEB","url":"https://github.com/team-alembic/ash_authentication/commit/255cfc9c0e511b7e0de39f8b3d676ae994fae06c"},{"type":"FIX","url":"https://github.com/team-alembic/ash_authentication/commit/5083af274013ebbf1681d863a1383cb1af77fff0"},{"type":"FIX","url":"https://github.com/team-alembic/ash_authentication/commit/f7271f40b25af22e1ff69dbc0f3b782b5b76d3f5"},{"type":"PACKAGE","url":"https://hex.pm/packages/ash_authentication"}],"affected":[{"package":{"name":"ash_authentication","ecosystem":"Hex","purl":"pkg:hex/ash_authentication"},"ranges":[{"type":"SEMVER","events":[{"introduced":"4.12.0"},{"fixed":"4.15.2"}]},{"type":"SEMVER","events":[{"introduced":"5.0.0-rc.0"},{"fixed":"5.0.0-rc.19"}]}],"versions":["4.12.0","4.13.0","4.13.1","4.13.2","4.13.3","4.13.4","4.13.5","4.13.6","4.13.7","4.14.0","4.14.1","4.14.2","4.15.0","4.15.1","5.0.0-rc.0","5.0.0-rc.1","5.0.0-rc.10","5.0.0-rc.11","5.0.0-rc.12","5.0.0-rc.13","5.0.0-rc.14","5.0.0-rc.15","5.0.0-rc.16","5.0.0-rc.17","5.0.0-rc.18","5.0.0-rc.2","5.0.0-rc.3","5.0.0-rc.4","5.0.0-rc.5","5.0.0-rc.6","5.0.0-rc.7","5.0.0-rc.8","5.0.0-rc.9"],"ecosystem_specific":{"$schema":"https://cna.erlef.org/schemas/osv/affected-0.1.0.json","modules":["'Elixir.AshAuthentication.AddOn.AuditLog.Transformer'","'Elixir.AshAuthentication.AddOn.AuditLog.Auditor'"],"program_files":["lib/ash_authentication/add_ons/audit_log/transformer.ex","lib/ash_authentication/add_ons/audit_log/auditor.ex"],"program_routines":["'Elixir.AshAuthentication.AddOn.AuditLog.Transformer':persist_logged_fields/3","'Elixir.AshAuthentication.AddOn.AuditLog.Auditor':get_params/2"]},"database_specific":{"program_files":["lib/ash_authentication/add_ons/audit_log/transformer.ex","lib/ash_authentication/add_ons/audit_log/auditor.ex"],"program_routines":["'Elixir.AshAuthentication.AddOn.AuditLog.Transformer':persist_logged_fields/3","'Elixir.AshAuthentication.AddOn.AuditLog.Auditor':get_params/2"],"$schema":"https://cna.erlef.org/schemas/osv/affected-0.1.0.json","source":"https://cna.erlef.org/osv/EEF-CVE-2026-139967.json","modules":["'Elixir.AshAuthentication.AddOn.AuditLog.Transformer'","'Elixir.AshAuthentication.AddOn.AuditLog.Auditor'"]}},{"ranges":[{"type":"GIT","repo":"https://github.com/team-alembic/ash_authentication","events":[{"introduced":"255cfc9c0e511b7e0de39f8b3d676ae994fae06c"},{"fixed":"5083af274013ebbf1681d863a1383cb1af77fff0"},{"fixed":"f7271f40b25af22e1ff69dbc0f3b782b5b76d3f5"}]}],"versions":["v4.15.1","v5.0.0-rc.18","v5.0.0-rc.17","v5.0.0-rc.16","v5.0.0-rc.15","v5.0.0-rc.14","v4.15.0","v4.14.2","v5.0.0-rc.13","v4.14.1","v5.0.0-rc.12","v5.0.0-rc.11","v5.0.0-rc.10","v4.14.0","v4.13.7","5.0.0-rc.9","5.0.0-rc.8","v5.0.0-rc.7","v5.0.0-rc.6","v5.0.0-rc.5","v5.0.0-rc.4","v5.0.0-rc.3","v5.0.0-rc.2","v5.0.0-rc.1","v5.0.0-rc.0","v4.13.6","v4.13.5","v4.13.4","v4.13.3","v4.13.2","v4.13.1","v4.13.0","v4.12.0"],"database_specific":{"source":"https://cna.erlef.org/osv/EEF-CVE-2026-139967.json","program_files":["lib/ash_authentication/add_ons/audit_log/transformer.ex","lib/ash_authentication/add_ons/audit_log/auditor.ex"],"program_routines":["'Elixir.AshAuthentication.AddOn.AuditLog.Transformer':persist_logged_fields/3","'Elixir.AshAuthentication.AddOn.AuditLog.Auditor':get_params/2"],"$schema":"https://cna.erlef.org/schemas/osv/affected-0.1.0.json","modules":["'Elixir.AshAuthentication.AddOn.AuditLog.Transformer'","'Elixir.AshAuthentication.AddOn.AuditLog.Auditor'"]}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V4","score":"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","source":"CNA"}],"credits":[{"name":"Glenn Rempe","type":"REPORTER"},{"name":"Zach Daniel","type":"COORDINATOR"},{"name":"Glenn Rempe","type":"REMEDIATION_DEVELOPER"},{"name":"Zach Daniel","type":"REMEDIATION_REVIEWER"}]}