{"id":"CVE-2026-105963","kind":"vulnerability","aliases":["CVE-2026-105963"],"related":[],"title":"plug_crypto: wrong-typed arguments leak secret key base into logs","description":"Externally-Generated Error Message Containing Sensitive Information vulnerability in plug_crypto in elixir-plug plug_crypto allows an unauthenticated remote attacker to expose the secret key base through application logs via a wrong-typed argument. Every public function in Plug.Crypto validates argument types in a function-head guard. A failed guard makes the Erlang VM raise FunctionClauseError with the actual argument values in the top stack frame, so the secret key base, a derived key, or the value an API key is compared against lands in that frame. The library's rescue blocks and Plug.Crypto.prune_args_from_stacktrace/1 only reach exceptions raised inside a function body, so they never see a guard failure. Plug.Cowboy and Bandit write the frame to the error log and attach it as crash_reason Logger metadata, which error trackers forward.\n\nTwo entry points take request data. Plug.Crypto.verify/4 exposes the secret key base when the token is neither a binary nor nil, which Phoenix.Token.verify/4 reaches because it forwards the token unguarded. Plug.Crypto.secure_compare/2 exposes the other operand when one side is not a binary, as happens when a missing request header yields nil. Reading the leaked value needs separate access to the logs or the error tracker, so the request alone does not disclose the secret to the attacker.\n\nThis issue affects plug: from 1.6.3 before 1.7.0; plug_crypto: from 1.0.0 before 2.2.1.","summary":"A failed type guard in plug_crypto makes the Erlang VM log a FunctionClauseError that carries the raw argument values, including the secret key base or the value an API key is compared against. An unauthenticated remote request can trigger it through Phoenix.Token.verify/4 or a missing header passed to secure_compare/2, and the secret then sits in application logs and error trackers.","severity":"medium","cvss":5.1,"epss":0.00715,"exploited":false,"exploited_at":null,"products":[],"ecosystems":[],"tags":["elixir","error-tracking","package","phoenix","plug","plug_crypto","self-hosted"],"not_affected_if":["no-plug-cowboy-or-bandit","patched-version"],"how_to_check":"- Check the plug_crypto version in `mix.lock` or with `mix deps | grep plug_crypto`; affected if below `2.2.1`\n- Check the plug version in `mix.lock`; affected if from `1.6.3` up to but not including `1.7.0`\n- Search application and error-tracker logs for FunctionClauseError entries from Plug.Crypto that show crash_reason metadata","fix":"- Upgrade plug_crypto to `2.2.1` or later\n- Upgrade plug to `1.7.0` or later\n- Rotate the secret key base and any API keys if affected log entries were forwarded to third-party error trackers","status":"open","published_at":"2026-10-23T10:16:40+00:00","first_seen_at":"2026-10-23T21:57:32+00:00","triaged_at":"2026-10-25T04:28:52+00:00","updated_at":"2026-10-25T04:28:52+00:00","category":"package","confidence":0.7,"triage":{"at":"2026-10-25T04:28:52Z","model":"claude-haiku-5-5","output":{"fix":"- Upgrade plug_crypto to `2.2.1` or later\n- Upgrade plug to `1.7.0` or later\n- Rotate the secret key base and any API keys if affected log entries were forwarded to third-party error trackers","reach":"internet","title":"plug_crypto: wrong-typed arguments leak secret key base into logs","impact":"medium","summary":"A failed type guard in plug_crypto makes the Erlang VM log a FunctionClauseError that carries the raw argument values, including the secret key base or the value an API key is compared against. An unauthenticated remote request can trigger it through Phoenix.Token.verify/4 or a missing header passed to secure_compare/2, and the secret then sits in application logs and error trackers.","category":"package","nicknames":[],"who_cares":["elixir","phoenix","plug","plug_crypto","self-hosted","error-tracking"],"confidence":0.7,"needs_auth":"no","worst_case":"secret key base lands in logs readable by log or tracker viewers","analyst_note":"Confirm whether Phoenix.Token.verify and secure_compare exposure is the only trigger path, and check the advisory at the plug_crypto GitHub security page for exact patched versions and any workaround.","how_to_check":"- Check the plug_crypto version in `mix.lock` or with `mix deps | grep plug_crypto`; affected if below `2.2.1`\n- Check the plug version in `mix.lock`; affected if from `1.6.3` up to but not including `1.7.0`\n- Search application and error-tracker logs for FunctionClauseError entries from Plug.Crypto that show crash_reason metadata","needs_analyst":true,"not_affected_if":["patched-version","no-plug-cowboy-or-bandit"],"who_is_affected":"Applications built on Phoenix or Plug that use Plug.Crypto token verification or secure_compare on request data, and that log errors with crash_reason metadata through Plug.Cowboy or Bandit. Exposure depends on logs being readable by someone who can reach them, since the request alone does not return the secret. Systems on plug_crypto 2.2.1 or plug 1.7.0 or later are not affected.","user_interaction":"no","needs_special_setup":"unknown","severity_if_unknown":"unknown"},"cost_usd":0.000771,"input_tokens":3758,"output_tokens":790,"severity_before":"medium"},"analyst_status":null,"analyst_note":null,"search":"'-105963':15A,18A '-2026':14A,17A '/4':75B,242C,260C '1.0.0':327C '1.6.3':321C '1.7.0':323C '2.2.1':329C 'access':296C 'actual':158C 'affect':318C 'allow':113C 'alon':307C 'api':60B,178C 'applic':90B,125C 'arg':194C 'argument':6A,49B,132C,139C,159C 'attach':223C 'attack':117C,315C 'bandit':214C 'base':10A,55B,123C,170C,247C 'binari':254C,280C 'block':191C 'bodi':204C 'carri':46B 'compar':63B,181C 'compare/2':83B,269C 'contain':100C 'crash':226C 'crypto':2A,27B,37B,106C,112C,325C 'cve':13A,16A 'data':239C 'deriv':172C 'disclos':310C 'elixir':19B,109C 'elixir-plug':108C 'entri':235C 'erlang':40B,152C 'error':21B,93B,98C,220C,231C,302C 'error-track':20B 'everi':133C 'except':199C 'expos':119C,243C,270C 'extern':96C 'externally-gener':95C 'fail':32B,148C 'failur':211C 'forward':233C,264C 'frame':165C,186C,217C 'function':135C,144C,203C 'function-head':143C 'functionclauseerror':44B,155C 'generat':97C 'guard':34B,146C,149C,210C 'happen':282C 'head':145C 'header':79B,287C 'host':30B 'includ':51B 'inform':102C 'insid':201C 'issu':317C 'key':9A,54B,61B,122C,169C,173C,179C,246C 'land':183C 'leak':7A,292C 'librari':188C 'log':12A,42B,91B,126C,221C,299C 'logger':228C 'make':38B,150C 'messag':99C 'metadata':229C 'miss':78B,285C 'need':294C 'neither':252C 'never':207C 'nil':256C,289C 'one':275C 'operand':273C 'packag':23B 'pass':80B 'phoenix':24B 'phoenix.token.verify':74B,259C 'phoenix.token.verify/4':73B,258C 'plug':1A,25B,26B,36B,105C,110C,111C,319C,324C 'plug.cowboy':212C 'plug.crypto':137C 'plug.crypto.prune':193C 'plug.crypto.secure':268C 'plug.crypto.verify':241C 'plug.crypto.verify/4':240C 'point':236C 'public':134C 'rais':154C,200C 'raw':48B 'reach':198C,261C 'read':290C 'reason':227C 'remot':67B,116C 'request':68B,238C,286C,306C 'rescu':190C 'secret':8A,53B,86B,121C,168C,245C,312C 'secur':82B 'see':208C 'self':29B 'self-host':28B 'sensit':101C 'separ':295C 'side':276C 'sit':88B 'stack':164C 'stacktrace/1':196C 'take':237C 'token':250C,266C 'top':163C 'track':22B 'tracker':94B,232C,303C 'trigger':70B 'two':234C 'type':5A,33B,131C,140C 'unauthent':66B,115C 'unguard':267C 'valid':138C 'valu':50B,58B,160C,176C,293C 'via':127C 'vm':41B,153C 'vulner':103C 'write':215C 'wrong':4A,130C 'wrong-typ':3A,129C 'yield':288C","nicknames":[],"mitigations":[],"who_affected":"Applications built on Phoenix or Plug that use Plug.Crypto token verification or secure_compare on request data, and that log errors with crash_reason metadata through Plug.Cowboy or Bandit. Exposure depends on logs being readable by someone who can reach them, since the request alone does not return the secret. Systems on plug_crypto 2.2.1 or plug 1.7.0 or later are not affected.","tier":"C","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-10-23T10:16:40+00:00","kev":null,"cvss_vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","cvss_by":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-105963","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-105963","severity":null,"published_at":"2026-10-23T10:16:40+00:00","modified_at":"2026-10-23T19:57:42+00:00","first_seen_at":"2026-10-23T21:57:32+00:00","fetched_at":"2026-10-23T22:29:03+00:00","note":null},{"source":"epss","external_id":"CVE-2026-105963","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-105963","severity":null,"published_at":null,"modified_at":null,"first_seen_at":"2026-10-24T07:15:51+00:00","fetched_at":"2026-10-24T07:15:51+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}