Search

Find a vulnerability

Search criteria

    2 vulnerabilities found for plug_crypto by elixir-plug

    CVE-2026-105963 (GCVE-0-2026-105963)

    Vulnerability from nvd – Published: 2026-10-23 09:56 – Updated: 2026-10-23 13:39
    VLAI
    Title
    Secret key base exposed in stack trace arguments on wrong-typed Plug.Crypto arguments
    Summary
    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. Two 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. This issue affects plug: from 1.6.3 before 1.7.0; plug_crypto: from 1.0.0 before 2.2.1.
    SSVC
    Exploitation: none Automatable: no Technical Impact: partial
    CISA Coordinator · CISA-ADP (v2.0.3)
    Decision recorded 2026-10-23 10:53 UTC
    CWE
    • CWE-532 - Insertion of Sensitive Information into Log File
    Assigner
    EEF CNA under the mitre root
    CNA scorecard A 96/100 over 318 records in the last 180 days details
    Impacted products
    Vendor Product Version
    elixir-plug plug Affected: 1.6.3 , < 1.7.0 (semver)
        cpe:2.3:a:elixir-plug:plug:*:*:*:*:*:*:*:*
    Create a notification for this product.
    elixir-plug plug Affected: 56000c33d8a0a2fbac491f8be06b9c5112bc2276 , < * (git)
        cpe:2.3:a:elixir-plug:plug:*:*:*:*:*:*:*:*
    Create a notification for this product.
    elixir-plug plug_crypto Affected: 1.0.0 , < 2.2.1 (semver)
        cpe:2.3:a:elixir-plug:plug_crypto:*:*:*:*:*:*:*:*
    Create a notification for this product.
    elixir-plug plug_crypto Affected: 2d078b7b8264c565f0ff71235c515f4f46882dcf , < 981887493dada0fce7003c61861c00dfbb0fc8c5 (git)
        cpe:2.3:a:elixir-plug:plug_crypto:*:*:*:*:*:*:*:*
    Create a notification for this product.
    Show details on NVD website

    {
      "containers": {
        "adp": [
          {
            "metrics": [
              {
                "other": {
                  "content": {
                    "id": "CVE-2026-105963",
                    "options": [
                      {
                        "Exploitation": "none"
                      },
                      {
                        "Automatable": "no"
                      },
                      {
                        "Technical Impact": "partial"
                      }
                    ],
                    "role": "CISA Coordinator",
                    "timestamp": "2026-10-23T10:53:00.474296Z",
                    "version": "2.0.3"
                  },
                  "type": "ssvc"
                }
              }
            ],
            "providerMetadata": {
              "dateUpdated": "2026-10-23T13:39:29.887Z",
              "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
              "shortName": "CISA-ADP"
            },
            "title": "CISA ADP Vulnrichment"
          }
        ],
        "cna": {
          "affected": [
            {
              "collectionURL": "https://repo.hex.pm",
              "cpes": [
                "cpe:2.3:a:elixir-plug:plug:*:*:*:*:*:*:*:*"
              ],
              "defaultStatus": "unaffected",
              "modules": [
                "\u0027Elixir.Plug.Crypto\u0027"
              ],
              "packageName": "plug",
              "packageURL": "pkg:hex/plug",
              "product": "plug",
              "programFiles": [
                "lib/plug/crypto.ex"
              ],
              "programRoutines": [
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:secure_compare/2"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:masked_compare/3"
                }
              ],
              "repo": "https://github.com/elixir-plug/plug",
              "vendor": "elixir-plug",
              "versions": [
                {
                  "lessThan": "1.7.0",
                  "status": "affected",
                  "version": "1.6.3",
                  "versionType": "semver"
                }
              ]
            },
            {
              "collectionURL": "https://github.com",
              "cpes": [
                "cpe:2.3:a:elixir-plug:plug:*:*:*:*:*:*:*:*"
              ],
              "defaultStatus": "unaffected",
              "modules": [
                "\u0027Elixir.Plug.Crypto\u0027"
              ],
              "packageName": "elixir-plug/plug",
              "packageURL": "pkg:github/elixir-plug/plug",
              "product": "plug",
              "programFiles": [
                "lib/plug/crypto.ex"
              ],
              "programRoutines": [
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:secure_compare/2"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:masked_compare/3"
                }
              ],
              "repo": "https://github.com/elixir-plug/plug",
              "vendor": "elixir-plug",
              "versions": [
                {
                  "lessThan": "*",
                  "status": "affected",
                  "version": "56000c33d8a0a2fbac491f8be06b9c5112bc2276",
                  "versionType": "git"
                }
              ]
            },
            {
              "collectionURL": "https://repo.hex.pm",
              "cpes": [
                "cpe:2.3:a:elixir-plug:plug_crypto:*:*:*:*:*:*:*:*"
              ],
              "defaultStatus": "unaffected",
              "modules": [
                "\u0027Elixir.Plug.Crypto\u0027",
                "\u0027Elixir.Plug.Crypto.MessageVerifier\u0027",
                "\u0027Elixir.Plug.Crypto.MessageEncryptor\u0027"
              ],
              "packageName": "plug_crypto",
              "packageURL": "pkg:hex/plug_crypto",
              "product": "plug_crypto",
              "programFiles": [
                "lib/plug/crypto.ex",
                "lib/plug/crypto/message_verifier.ex",
                "lib/plug/crypto/message_encryptor.ex"
              ],
              "programRoutines": [
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:verify/4"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:decrypt/4"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:secure_compare/2"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:masked_compare/3"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:mask/2"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:sign/4"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:encrypt/4"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto.MessageVerifier\u0027:sign/3"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto.MessageVerifier\u0027:verify/2"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto.MessageEncryptor\u0027:encrypt/4"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto.MessageEncryptor\u0027:decrypt/4"
                }
              ],
              "repo": "https://github.com/elixir-plug/plug_crypto",
              "vendor": "elixir-plug",
              "versions": [
                {
                  "lessThan": "2.2.1",
                  "status": "affected",
                  "version": "1.0.0",
                  "versionType": "semver"
                }
              ]
            },
            {
              "collectionURL": "https://github.com",
              "cpes": [
                "cpe:2.3:a:elixir-plug:plug_crypto:*:*:*:*:*:*:*:*"
              ],
              "defaultStatus": "unaffected",
              "modules": [
                "\u0027Elixir.Plug.Crypto\u0027",
                "\u0027Elixir.Plug.Crypto.MessageVerifier\u0027",
                "\u0027Elixir.Plug.Crypto.MessageEncryptor\u0027"
              ],
              "packageName": "elixir-plug/plug_crypto",
              "packageURL": "pkg:github/elixir-plug/plug_crypto",
              "product": "plug_crypto",
              "programFiles": [
                "lib/plug/crypto.ex",
                "lib/plug/crypto/message_verifier.ex",
                "lib/plug/crypto/message_encryptor.ex"
              ],
              "programRoutines": [
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:verify/4"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:decrypt/4"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:secure_compare/2"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:masked_compare/3"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:mask/2"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:sign/4"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:encrypt/4"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto.MessageVerifier\u0027:sign/3"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto.MessageVerifier\u0027:verify/2"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto.MessageEncryptor\u0027:encrypt/4"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto.MessageEncryptor\u0027:decrypt/4"
                }
              ],
              "repo": "https://github.com/elixir-plug/plug_crypto",
              "vendor": "elixir-plug",
              "versions": [
                {
                  "lessThan": "981887493dada0fce7003c61861c00dfbb0fc8c5",
                  "status": "affected",
                  "version": "2d078b7b8264c565f0ff71235c515f4f46882dcf",
                  "versionType": "git"
                }
              ]
            }
          ],
          "configurations": [
            {
              "lang": "en",
              "supportingMedia": [
                {
                  "base64": false,
                  "type": "text/html",
                  "value": "\u003cp\u003eRequest-data reachability needs an application that passes unvalidated request data into \u003ccode\u003ePlug.Crypto\u003c/code\u003e. Either a controller or plug that hands \u003ccode\u003eparams[\"token\"]\u003c/code\u003e to \u003ccode\u003ePhoenix.Token.verify/4\u003c/code\u003e or \u003ccode\u003ePhoenix.Token.decrypt/4\u003c/code\u003e, where \u003ccode\u003ePlug.Parsers\u003c/code\u003e yields a list for \u003ccode\u003etoken[]=x\u003c/code\u003e in a query string and an integer or a map for a JSON body, or a call to \u003ccode\u003ePlug.Crypto.secure_compare/2\u003c/code\u003e on a value that can be nil, such as \u003ccode\u003eList.first(get_req_header(conn, \"x-api-key\"))\u003c/code\u003e compared against a configured secret. Disclosure of the leaked value additionally needs read access to the application logs or to an error tracker that receives \u003ccode\u003ecrash_reason\u003c/code\u003e metadata. The remaining affected functions require direct misuse by application code and have no request-data trigger.\u003c/p\u003e"
                },
                {
                  "base64": false,
                  "type": "text/markdown",
                  "value": "Request-data reachability needs an application that passes unvalidated request data into `Plug.Crypto`. Either a controller or plug that hands `params[\"token\"]` to `Phoenix.Token.verify/4` or `Phoenix.Token.decrypt/4`, where `Plug.Parsers` yields a list for `token[]=x` in a query string and an integer or a map for a JSON body, or a call to `Plug.Crypto.secure_compare/2` on a value that can be nil, such as `List.first(get_req_header(conn, \"x-api-key\"))` compared against a configured secret. Disclosure of the leaked value additionally needs read access to the application logs or to an error tracker that receives `crash_reason` metadata. The remaining affected functions require direct misuse by application code and have no request-data trigger."
                }
              ],
              "value": "Request-data reachability needs an application that passes unvalidated request data into Plug.Crypto. Either a controller or plug that hands params[\"token\"] to Phoenix.Token.verify/4 or Phoenix.Token.decrypt/4, where Plug.Parsers yields a list for token[]=x in a query string and an integer or a map for a JSON body, or a call to Plug.Crypto.secure_compare/2 on a value that can be nil, such as List.first(get_req_header(conn, \"x-api-key\")) compared against a configured secret. Disclosure of the leaked value additionally needs read access to the application logs or to an error tracker that receives crash_reason metadata. The remaining affected functions require direct misuse by application code and have no request-data trigger."
            }
          ],
          "cpeApplicability": [
            {
              "nodes": [
                {
                  "cpeMatch": [
                    {
                      "criteria": "cpe:2.3:a:elixir-plug:plug:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "1.7.0",
                      "versionStartIncluding": "1.6.3",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:a:elixir-plug:plug_crypto:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "2.2.1",
                      "versionStartIncluding": "1.0.0",
                      "vulnerable": true
                    }
                  ],
                  "negate": false,
                  "operator": "OR"
                }
              ],
              "operator": "AND"
            }
          ],
          "credits": [
            {
              "lang": "en",
              "type": "reporter",
              "value": "Neil Berkman"
            },
            {
              "lang": "en",
              "type": "finder",
              "value": "Neil Berkman"
            },
            {
              "lang": "en",
              "type": "remediation developer",
              "value": "Neil Berkman"
            },
            {
              "lang": "en",
              "type": "coordinator",
              "value": "Jonatan M\u00e4nnchen / EEF"
            },
            {
              "lang": "en",
              "type": "remediation verifier",
              "value": "Jos\u00e9 Valim"
            }
          ],
          "dateAssigned": "2026-10-22T09:25:19.000Z",
          "descriptions": [
            {
              "lang": "en",
              "supportingMedia": [
                {
                  "base64": false,
                  "type": "text/html",
                  "value": "\u003cp\u003eExternally-Generated Error Message Containing Sensitive Information vulnerability in \u003ccode\u003eplug_crypto\u003c/code\u003e 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 \u003ccode\u003ePlug.Crypto\u003c/code\u003e validates argument types in a function-head guard. A failed guard makes the Erlang VM raise \u003ccode\u003eFunctionClauseError\u003c/code\u003e 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\u0027s \u003ccode\u003erescue\u003c/code\u003e blocks and \u003ccode\u003ePlug.Crypto.prune_args_from_stacktrace/1\u003c/code\u003e 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 \u003ccode\u003ecrash_reason\u003c/code\u003e Logger metadata, which error trackers forward.\u003c/p\u003e\n\u003cp\u003eTwo entry points take request data. \u003ccode\u003ePlug.Crypto.verify/4\u003c/code\u003e exposes the secret key base when the token is neither a binary nor nil, which \u003ccode\u003ePhoenix.Token.verify/4\u003c/code\u003e reaches because it forwards the token unguarded. \u003ccode\u003ePlug.Crypto.secure_compare/2\u003c/code\u003e 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.\u003c/p\u003e\n\u003cp\u003eThis issue affects plug: from 1.6.3 before 1.7.0; plug_crypto: from 1.0.0 before 2.2.1.\u003c/p\u003e"
                },
                {
                  "base64": false,
                  "type": "text/markdown",
                  "value": "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\u0027s `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."
                }
              ],
              "value": "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\u0027s 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."
            }
          ],
          "impacts": [
            {
              "capecId": "CAPEC-54",
              "descriptions": [
                {
                  "lang": "en",
                  "supportingMedia": [
                    {
                      "base64": false,
                      "type": "text/html",
                      "value": "\u003cp\u003eAn unauthenticated attacker sends one request with a wrong-typed parameter, or omits a header, and the secret key base or the compared secret is written into the application log and into \u003ccode\u003ecrash_reason\u003c/code\u003e metadata forwarded to error trackers. Anyone who can read those logs then holds a key sufficient to mint session cookies and tokens under any salt.\u003c/p\u003e"
                    },
                    {
                      "base64": false,
                      "type": "text/markdown",
                      "value": "An unauthenticated attacker sends one request with a wrong-typed parameter, or omits a header, and the secret key base or the compared secret is written into the application log and into `crash_reason` metadata forwarded to error trackers. Anyone who can read those logs then holds a key sufficient to mint session cookies and tokens under any salt."
                    }
                  ],
                  "value": "An unauthenticated attacker sends one request with a wrong-typed parameter, or omits a header, and the secret key base or the compared secret is written into the application log and into crash_reason metadata forwarded to error trackers. Anyone who can read those logs then holds a key sufficient to mint session cookies and tokens under any salt."
                }
              ]
            }
          ],
          "metrics": [
            {
              "cvssV4_0": {
                "Automatable": "NOT_DEFINED",
                "Recovery": "NOT_DEFINED",
                "Safety": "NOT_DEFINED",
                "attackComplexity": "LOW",
                "attackRequirements": "NONE",
                "attackVector": "NETWORK",
                "baseScore": 5.1,
                "baseSeverity": "MEDIUM",
                "privilegesRequired": "HIGH",
                "providerUrgency": "NOT_DEFINED",
                "subAvailabilityImpact": "NONE",
                "subConfidentialityImpact": "NONE",
                "subIntegrityImpact": "NONE",
                "userInteraction": "NONE",
                "valueDensity": "NOT_DEFINED",
                "vectorString": "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",
                "version": "4.0",
                "vulnAvailabilityImpact": "NONE",
                "vulnConfidentialityImpact": "LOW",
                "vulnIntegrityImpact": "NONE",
                "vulnerabilityResponseEffort": "NOT_DEFINED"
              },
              "format": "CVSS",
              "scenarios": [
                {
                  "lang": "en",
                  "value": "GENERAL"
                }
              ]
            }
          ],
          "problemTypes": [
            {
              "descriptions": [
                {
                  "cweId": "CWE-532",
                  "description": "CWE-532 Insertion of Sensitive Information into Log File",
                  "lang": "en",
                  "type": "CWE"
                }
              ]
            }
          ],
          "providerMetadata": {
            "dateUpdated": "2026-10-23T09:56:58.885Z",
            "orgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
            "shortName": "EEF"
          },
          "references": [
            {
              "name": "Secret key base exposed in stack trace arguments on wrong-typed Plug.Crypto arguments",
              "tags": [
                "vendor-advisory",
                "related"
              ],
              "url": "https://github.com/elixir-plug/plug/security/advisories/GHSA-ffw9-w85g-f2vh"
            },
            {
              "name": "EEF CNA record for CVE-2026-105963",
              "tags": [
                "related"
              ],
              "url": "https://cna.erlef.org/cves/CVE-2026-105963.html"
            },
            {
              "name": "OSV record EEF-CVE-2026-105963",
              "tags": [
                "related"
              ],
              "url": "https://osv.dev/vulnerability/EEF-CVE-2026-105963"
            },
            {
              "name": "Introducing commit 56000c3 in elixir-plug/plug",
              "tags": [
                "related"
              ],
              "url": "https://github.com/elixir-plug/plug/commit/56000c33d8a0a2fbac491f8be06b9c5112bc2276"
            },
            {
              "name": "Fix commit aeaa90e in elixir-plug/plug",
              "tags": [
                "patch"
              ],
              "url": "https://github.com/elixir-plug/plug/commit/aeaa90e76b73ea90c3ecca9aae16fce71bd2a8d4"
            },
            {
              "name": "Introducing commit 2d078b7 in elixir-plug/plug_crypto",
              "tags": [
                "related"
              ],
              "url": "https://github.com/elixir-plug/plug_crypto/commit/2d078b7b8264c565f0ff71235c515f4f46882dcf"
            },
            {
              "name": "Fix commit 9818874 in elixir-plug/plug_crypto",
              "tags": [
                "patch"
              ],
              "url": "https://github.com/elixir-plug/plug_crypto/commit/981887493dada0fce7003c61861c00dfbb0fc8c5"
            }
          ],
          "source": {
            "discovery": "EXTERNAL"
          },
          "title": "Secret key base exposed in stack trace arguments on wrong-typed Plug.Crypto arguments",
          "workarounds": [
            {
              "lang": "en",
              "supportingMedia": [
                {
                  "base64": false,
                  "type": "text/html",
                  "value": "\u003cp\u003eCheck argument types in the calling code before entering \u003ccode\u003ePlug.Crypto\u003c/code\u003e, so no head guard ever fails. Pass a token to \u003ccode\u003ePhoenix.Token.verify/4\u003c/code\u003e, \u003ccode\u003ePhoenix.Token.decrypt/4\u003c/code\u003e, \u003ccode\u003ePlug.Crypto.verify/4\u003c/code\u003e or \u003ccode\u003ePlug.Crypto.decrypt/4\u003c/code\u003e only when \u003ccode\u003eis_binary(token)\u003c/code\u003e holds, and treat anything else as an invalid token. Call \u003ccode\u003ePlug.Crypto.secure_compare/2\u003c/code\u003e only when both operands are binaries, treating a missing header or parameter as a failed comparison rather than passing nil.\u003c/p\u003e\n\u003cp\u003eWhere the leaked value matters more than the crash, configuring the error tracker to drop stack-frame arguments also keeps the secret out of the forwarded report. For Sentry this means not sending \u003ccode\u003evars\u003c/code\u003e with the crash report. This narrows exposure but leaves the value in the local error log.\u003c/p\u003e"
                },
                {
                  "base64": false,
                  "type": "text/markdown",
                  "value": "Check argument types in the calling code before entering `Plug.Crypto`, so no head guard ever fails. Pass a token to `Phoenix.Token.verify/4`, `Phoenix.Token.decrypt/4`, `Plug.Crypto.verify/4` or `Plug.Crypto.decrypt/4` only when `is_binary(token)` holds, and treat anything else as an invalid token. Call `Plug.Crypto.secure_compare/2` only when both operands are binaries, treating a missing header or parameter as a failed comparison rather than passing nil.\n\nWhere the leaked value matters more than the crash, configuring the error tracker to drop stack-frame arguments also keeps the secret out of the forwarded report. For Sentry this means not sending `vars` with the crash report. This narrows exposure but leaves the value in the local error log."
                }
              ],
              "value": "Check argument types in the calling code before entering Plug.Crypto, so no head guard ever fails. Pass a token to Phoenix.Token.verify/4, Phoenix.Token.decrypt/4, Plug.Crypto.verify/4 or Plug.Crypto.decrypt/4 only when is_binary(token) holds, and treat anything else as an invalid token. Call Plug.Crypto.secure_compare/2 only when both operands are binaries, treating a missing header or parameter as a failed comparison rather than passing nil.\n\nWhere the leaked value matters more than the crash, configuring the error tracker to drop stack-frame arguments also keeps the secret out of the forwarded report. For Sentry this means not sending vars with the crash report. This narrows exposure but leaves the value in the local error log."
            }
          ],
          "x_proofOfConcept": [
            {
              "lang": "en",
              "supportingMedia": [
                {
                  "base64": false,
                  "type": "text/html",
                  "value": "\u003col\u003e\n\u003cli\u003eRun an application that depends on \u003ccode\u003eplug_crypto\u003c/code\u003e and exposes a route calling \u003ccode\u003ePhoenix.Token.verify(secret_key_base, \"user auth\", conn.params[\"token\"])\u003c/code\u003e, plus a route calling \u003ccode\u003ePlug.Crypto.secure_compare(List.first(get_req_header(conn, \"x-api-key\")), api_key)\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eSend \u003ccode\u003eGET /verify?token[]=x\u003c/code\u003e. \u003ccode\u003ePlug.Parsers\u003c/code\u003e yields a list for the bracket syntax, so the token argument is a list.\u003c/li\u003e\n\u003cli\u003eObserve the 500 response and read the error log. The top frame prints \u003ccode\u003ePlug.Crypto.verify(\"SECRET_KEY_BASE_...\", \"user auth\", [\"x\"], [])\u003c/code\u003e with the secret key base in full, and the same frame is attached as \u003ccode\u003ecrash_reason\u003c/code\u003e Logger metadata.\u003c/li\u003e\n\u003cli\u003eSend \u003ccode\u003eGET /api\u003c/code\u003e with no \u003ccode\u003ex-api-key\u003c/code\u003e header. The header lookup yields nil, and the frame prints \u003ccode\u003ePlug.Crypto.secure_compare(nil, \"\u0026lt;configured API key\u0026gt;\")\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eA JSON body of \u003ccode\u003e{\"token\": 123}\u003c/code\u003e to the first route gives the same result with an integer argument.\u003c/li\u003e\n\u003c/ol\u003e"
                },
                {
                  "base64": false,
                  "type": "text/markdown",
                  "value": "1. Run an application that depends on `plug_crypto` and exposes a route calling `Phoenix.Token.verify(secret_key_base, \"user auth\", conn.params[\"token\"])`, plus a route calling `Plug.Crypto.secure_compare(List.first(get_req_header(conn, \"x-api-key\")), api_key)`.\n2. Send `GET /verify?token[]=x`. `Plug.Parsers` yields a list for the bracket syntax, so the token argument is a list.\n3. Observe the 500 response and read the error log. The top frame prints `Plug.Crypto.verify(\"SECRET_KEY_BASE_...\", \"user auth\", [\"x\"], [])` with the secret key base in full, and the same frame is attached as `crash_reason` Logger metadata.\n4. Send `GET /api` with no `x-api-key` header. The header lookup yields nil, and the frame prints `Plug.Crypto.secure_compare(nil, \"\u003cconfigured API key\u003e\")`.\n5. A JSON body of `{\"token\": 123}` to the first route gives the same result with an integer argument."
                }
              ],
              "value": "* Run an application that depends on plug_crypto and exposes a route calling Phoenix.Token.verify(secret_key_base, \"user auth\", conn.params[\"token\"]), plus a route calling Plug.Crypto.secure_compare(List.first(get_req_header(conn, \"x-api-key\")), api_key).\n* Send GET /verify?token[]=x. Plug.Parsers yields a list for the bracket syntax, so the token argument is a list.\n* Observe the 500 response and read the error log. The top frame prints Plug.Crypto.verify(\"SECRET_KEY_BASE_...\", \"user auth\", [\"x\"], []) with the secret key base in full, and the same frame is attached as crash_reason Logger metadata.\n* Send GET /api with no x-api-key header. The header lookup yields nil, and the frame prints Plug.Crypto.secure_compare(nil, \"\u003cconfigured API key\u003e\").\n* A JSON body of {\"token\": 123} to the first route gives the same result with an integer argument."
            }
          ],
          "x_technicalAnalysis": [
            {
              "lang": "en",
              "supportingMedia": [
                {
                  "base64": false,
                  "type": "text/html",
                  "value": "\u003cp\u003e\u003cstrong\u003e1. Type checks in function-head guards.\u003c/strong\u003e Every public function in \u003ccode\u003ePlug.Crypto\u003c/code\u003e validates its arguments in a head guard, for example \u003ccode\u003esecure_compare/2\u003c/code\u003e with \u003ccode\u003ewhen is_binary(left) and is_binary(right)\u003c/code\u003e and \u003ccode\u003everify/4\u003c/code\u003e with \u003ccode\u003ewhen is_binary(key_base) and is_binary(salt) and is_binary(token)\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e2. The VM builds the error, not the library.\u003c/strong\u003e When no clause matches, the Erlang VM raises \u003ccode\u003eFunctionClauseError\u003c/code\u003e and the top stack frame holds the actual argument values. The library\u0027s \u003ccode\u003erescue ... reraise\u003c/code\u003e blocks and \u003ccode\u003ePlug.Crypto.prune_args_from_stacktrace/1\u003c/code\u003e only apply to exceptions raised inside a function body, so a guard failure never reaches them. In \u003ccode\u003eplug_crypto\u003c/code\u003e the same commit that added \u003ccode\u003eprune_args_from_stacktrace/1\u003c/code\u003e also added these guards.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e3. Which value leaks.\u003c/strong\u003e \u003ccode\u003everify/4\u003c/code\u003e and \u003ccode\u003esign/4\u003c/code\u003e put the secret key base in the frame. \u003ccode\u003edecrypt/4\u003c/code\u003e has no \u003ccode\u003eis_binary(token)\u003c/code\u003e guard on its main clause, so the key is derived first and the failing guard belongs to \u003ccode\u003eMessageEncryptor.decrypt/4\u003c/code\u003e, placing the derived 32-byte key in the frame. \u003ccode\u003esecure_compare/2\u003c/code\u003e places the other operand in the frame, which is the server-side secret when a request value is nil.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e4. The frame reaches logs and error trackers.\u003c/strong\u003e Plug.Cowboy and Bandit write the formatted frame, arguments included, to the error log and attach it as \u003ccode\u003ecrash_reason\u003c/code\u003e Logger metadata. Error trackers forward it; Sentry\u0027s handler sends crash reports by default and serializes frame arguments as \u003ccode\u003evars\u003c/code\u003e.\u003c/p\u003e"
                },
                {
                  "base64": false,
                  "type": "text/markdown",
                  "value": "**1. Type checks in function-head guards.** Every public function in `Plug.Crypto` validates its arguments in a head guard, for example `secure_compare/2` with `when is_binary(left) and is_binary(right)` and `verify/4` with `when is_binary(key_base) and is_binary(salt) and is_binary(token)`.\n\n**2. The VM builds the error, not the library.** When no clause matches, the Erlang VM raises `FunctionClauseError` and the top stack frame holds the actual argument values. The library\u0027s `rescue ... reraise` blocks and `Plug.Crypto.prune_args_from_stacktrace/1` only apply to exceptions raised inside a function body, so a guard failure never reaches them. In `plug_crypto` the same commit that added `prune_args_from_stacktrace/1` also added these guards.\n\n**3. Which value leaks.** `verify/4` and `sign/4` put the secret key base in the frame. `decrypt/4` has no `is_binary(token)` guard on its main clause, so the key is derived first and the failing guard belongs to `MessageEncryptor.decrypt/4`, placing the derived 32-byte key in the frame. `secure_compare/2` places the other operand in the frame, which is the server-side secret when a request value is nil.\n\n**4. The frame reaches logs and error trackers.** Plug.Cowboy and Bandit write the formatted frame, arguments included, to the error log and attach it as `crash_reason` Logger metadata. Error trackers forward it; Sentry\u0027s handler sends crash reports by default and serializes frame arguments as `vars`."
                }
              ],
              "value": "1. Type checks in function-head guards. Every public function in Plug.Crypto validates its arguments in a head guard, for example secure_compare/2 with when is_binary(left) and is_binary(right) and verify/4 with when is_binary(key_base) and is_binary(salt) and is_binary(token).\n\n2. The VM builds the error, not the library. When no clause matches, the Erlang VM raises FunctionClauseError and the top stack frame holds the actual argument values. The library\u0027s rescue ... reraise blocks and Plug.Crypto.prune_args_from_stacktrace/1 only apply to exceptions raised inside a function body, so a guard failure never reaches them. In plug_crypto the same commit that added prune_args_from_stacktrace/1 also added these guards.\n\n3. Which value leaks. verify/4 and sign/4 put the secret key base in the frame. decrypt/4 has no is_binary(token) guard on its main clause, so the key is derived first and the failing guard belongs to MessageEncryptor.decrypt/4, placing the derived 32-byte key in the frame. secure_compare/2 places the other operand in the frame, which is the server-side secret when a request value is nil.\n\n4. The frame reaches logs and error trackers. Plug.Cowboy and Bandit write the formatted frame, arguments included, to the error log and attach it as crash_reason Logger metadata. Error trackers forward it; Sentry\u0027s handler sends crash reports by default and serializes frame arguments as vars."
            }
          ]
        }
      },
      "cveMetadata": {
        "assignerOrgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
        "assignerShortName": "EEF",
        "cveId": "CVE-2026-105963",
        "datePublished": "2026-10-23T09:56:58.885Z",
        "dateReserved": "2026-10-06T10:30:01.805Z",
        "dateUpdated": "2026-10-23T13:39:29.887Z",
        "state": "PUBLISHED"
      },
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }

    CVE-2026-105963 (GCVE-0-2026-105963)

    Vulnerability from cvelistv5 – Published: 2026-10-23 09:56 – Updated: 2026-10-23 13:39
    VLAI
    Title
    Secret key base exposed in stack trace arguments on wrong-typed Plug.Crypto arguments
    Summary
    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. Two 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. This issue affects plug: from 1.6.3 before 1.7.0; plug_crypto: from 1.0.0 before 2.2.1.
    SSVC
    Exploitation: none Automatable: no Technical Impact: partial
    CISA Coordinator · CISA-ADP (v2.0.3)
    Decision recorded 2026-10-23 10:53 UTC
    CWE
    • CWE-532 - Insertion of Sensitive Information into Log File
    Assigner
    EEF CNA under the mitre root
    CNA scorecard A 96/100 over 318 records in the last 180 days details
    Impacted products
    Vendor Product Version
    elixir-plug plug Affected: 1.6.3 , < 1.7.0 (semver)
        cpe:2.3:a:elixir-plug:plug:*:*:*:*:*:*:*:*
    Create a notification for this product.
    elixir-plug plug Affected: 56000c33d8a0a2fbac491f8be06b9c5112bc2276 , < * (git)
        cpe:2.3:a:elixir-plug:plug:*:*:*:*:*:*:*:*
    Create a notification for this product.
    elixir-plug plug_crypto Affected: 1.0.0 , < 2.2.1 (semver)
        cpe:2.3:a:elixir-plug:plug_crypto:*:*:*:*:*:*:*:*
    Create a notification for this product.
    elixir-plug plug_crypto Affected: 2d078b7b8264c565f0ff71235c515f4f46882dcf , < 981887493dada0fce7003c61861c00dfbb0fc8c5 (git)
        cpe:2.3:a:elixir-plug:plug_crypto:*:*:*:*:*:*:*:*
    Create a notification for this product.
    Show details on NVD website

    {
      "containers": {
        "adp": [
          {
            "metrics": [
              {
                "other": {
                  "content": {
                    "id": "CVE-2026-105963",
                    "options": [
                      {
                        "Exploitation": "none"
                      },
                      {
                        "Automatable": "no"
                      },
                      {
                        "Technical Impact": "partial"
                      }
                    ],
                    "role": "CISA Coordinator",
                    "timestamp": "2026-10-23T10:53:00.474296Z",
                    "version": "2.0.3"
                  },
                  "type": "ssvc"
                }
              }
            ],
            "providerMetadata": {
              "dateUpdated": "2026-10-23T13:39:29.887Z",
              "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
              "shortName": "CISA-ADP"
            },
            "title": "CISA ADP Vulnrichment"
          }
        ],
        "cna": {
          "affected": [
            {
              "collectionURL": "https://repo.hex.pm",
              "cpes": [
                "cpe:2.3:a:elixir-plug:plug:*:*:*:*:*:*:*:*"
              ],
              "defaultStatus": "unaffected",
              "modules": [
                "\u0027Elixir.Plug.Crypto\u0027"
              ],
              "packageName": "plug",
              "packageURL": "pkg:hex/plug",
              "product": "plug",
              "programFiles": [
                "lib/plug/crypto.ex"
              ],
              "programRoutines": [
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:secure_compare/2"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:masked_compare/3"
                }
              ],
              "repo": "https://github.com/elixir-plug/plug",
              "vendor": "elixir-plug",
              "versions": [
                {
                  "lessThan": "1.7.0",
                  "status": "affected",
                  "version": "1.6.3",
                  "versionType": "semver"
                }
              ]
            },
            {
              "collectionURL": "https://github.com",
              "cpes": [
                "cpe:2.3:a:elixir-plug:plug:*:*:*:*:*:*:*:*"
              ],
              "defaultStatus": "unaffected",
              "modules": [
                "\u0027Elixir.Plug.Crypto\u0027"
              ],
              "packageName": "elixir-plug/plug",
              "packageURL": "pkg:github/elixir-plug/plug",
              "product": "plug",
              "programFiles": [
                "lib/plug/crypto.ex"
              ],
              "programRoutines": [
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:secure_compare/2"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:masked_compare/3"
                }
              ],
              "repo": "https://github.com/elixir-plug/plug",
              "vendor": "elixir-plug",
              "versions": [
                {
                  "lessThan": "*",
                  "status": "affected",
                  "version": "56000c33d8a0a2fbac491f8be06b9c5112bc2276",
                  "versionType": "git"
                }
              ]
            },
            {
              "collectionURL": "https://repo.hex.pm",
              "cpes": [
                "cpe:2.3:a:elixir-plug:plug_crypto:*:*:*:*:*:*:*:*"
              ],
              "defaultStatus": "unaffected",
              "modules": [
                "\u0027Elixir.Plug.Crypto\u0027",
                "\u0027Elixir.Plug.Crypto.MessageVerifier\u0027",
                "\u0027Elixir.Plug.Crypto.MessageEncryptor\u0027"
              ],
              "packageName": "plug_crypto",
              "packageURL": "pkg:hex/plug_crypto",
              "product": "plug_crypto",
              "programFiles": [
                "lib/plug/crypto.ex",
                "lib/plug/crypto/message_verifier.ex",
                "lib/plug/crypto/message_encryptor.ex"
              ],
              "programRoutines": [
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:verify/4"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:decrypt/4"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:secure_compare/2"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:masked_compare/3"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:mask/2"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:sign/4"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:encrypt/4"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto.MessageVerifier\u0027:sign/3"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto.MessageVerifier\u0027:verify/2"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto.MessageEncryptor\u0027:encrypt/4"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto.MessageEncryptor\u0027:decrypt/4"
                }
              ],
              "repo": "https://github.com/elixir-plug/plug_crypto",
              "vendor": "elixir-plug",
              "versions": [
                {
                  "lessThan": "2.2.1",
                  "status": "affected",
                  "version": "1.0.0",
                  "versionType": "semver"
                }
              ]
            },
            {
              "collectionURL": "https://github.com",
              "cpes": [
                "cpe:2.3:a:elixir-plug:plug_crypto:*:*:*:*:*:*:*:*"
              ],
              "defaultStatus": "unaffected",
              "modules": [
                "\u0027Elixir.Plug.Crypto\u0027",
                "\u0027Elixir.Plug.Crypto.MessageVerifier\u0027",
                "\u0027Elixir.Plug.Crypto.MessageEncryptor\u0027"
              ],
              "packageName": "elixir-plug/plug_crypto",
              "packageURL": "pkg:github/elixir-plug/plug_crypto",
              "product": "plug_crypto",
              "programFiles": [
                "lib/plug/crypto.ex",
                "lib/plug/crypto/message_verifier.ex",
                "lib/plug/crypto/message_encryptor.ex"
              ],
              "programRoutines": [
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:verify/4"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:decrypt/4"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:secure_compare/2"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:masked_compare/3"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:mask/2"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:sign/4"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto\u0027:encrypt/4"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto.MessageVerifier\u0027:sign/3"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto.MessageVerifier\u0027:verify/2"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto.MessageEncryptor\u0027:encrypt/4"
                },
                {
                  "name": "\u0027Elixir.Plug.Crypto.MessageEncryptor\u0027:decrypt/4"
                }
              ],
              "repo": "https://github.com/elixir-plug/plug_crypto",
              "vendor": "elixir-plug",
              "versions": [
                {
                  "lessThan": "981887493dada0fce7003c61861c00dfbb0fc8c5",
                  "status": "affected",
                  "version": "2d078b7b8264c565f0ff71235c515f4f46882dcf",
                  "versionType": "git"
                }
              ]
            }
          ],
          "configurations": [
            {
              "lang": "en",
              "supportingMedia": [
                {
                  "base64": false,
                  "type": "text/html",
                  "value": "\u003cp\u003eRequest-data reachability needs an application that passes unvalidated request data into \u003ccode\u003ePlug.Crypto\u003c/code\u003e. Either a controller or plug that hands \u003ccode\u003eparams[\"token\"]\u003c/code\u003e to \u003ccode\u003ePhoenix.Token.verify/4\u003c/code\u003e or \u003ccode\u003ePhoenix.Token.decrypt/4\u003c/code\u003e, where \u003ccode\u003ePlug.Parsers\u003c/code\u003e yields a list for \u003ccode\u003etoken[]=x\u003c/code\u003e in a query string and an integer or a map for a JSON body, or a call to \u003ccode\u003ePlug.Crypto.secure_compare/2\u003c/code\u003e on a value that can be nil, such as \u003ccode\u003eList.first(get_req_header(conn, \"x-api-key\"))\u003c/code\u003e compared against a configured secret. Disclosure of the leaked value additionally needs read access to the application logs or to an error tracker that receives \u003ccode\u003ecrash_reason\u003c/code\u003e metadata. The remaining affected functions require direct misuse by application code and have no request-data trigger.\u003c/p\u003e"
                },
                {
                  "base64": false,
                  "type": "text/markdown",
                  "value": "Request-data reachability needs an application that passes unvalidated request data into `Plug.Crypto`. Either a controller or plug that hands `params[\"token\"]` to `Phoenix.Token.verify/4` or `Phoenix.Token.decrypt/4`, where `Plug.Parsers` yields a list for `token[]=x` in a query string and an integer or a map for a JSON body, or a call to `Plug.Crypto.secure_compare/2` on a value that can be nil, such as `List.first(get_req_header(conn, \"x-api-key\"))` compared against a configured secret. Disclosure of the leaked value additionally needs read access to the application logs or to an error tracker that receives `crash_reason` metadata. The remaining affected functions require direct misuse by application code and have no request-data trigger."
                }
              ],
              "value": "Request-data reachability needs an application that passes unvalidated request data into Plug.Crypto. Either a controller or plug that hands params[\"token\"] to Phoenix.Token.verify/4 or Phoenix.Token.decrypt/4, where Plug.Parsers yields a list for token[]=x in a query string and an integer or a map for a JSON body, or a call to Plug.Crypto.secure_compare/2 on a value that can be nil, such as List.first(get_req_header(conn, \"x-api-key\")) compared against a configured secret. Disclosure of the leaked value additionally needs read access to the application logs or to an error tracker that receives crash_reason metadata. The remaining affected functions require direct misuse by application code and have no request-data trigger."
            }
          ],
          "cpeApplicability": [
            {
              "nodes": [
                {
                  "cpeMatch": [
                    {
                      "criteria": "cpe:2.3:a:elixir-plug:plug:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "1.7.0",
                      "versionStartIncluding": "1.6.3",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:a:elixir-plug:plug_crypto:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "2.2.1",
                      "versionStartIncluding": "1.0.0",
                      "vulnerable": true
                    }
                  ],
                  "negate": false,
                  "operator": "OR"
                }
              ],
              "operator": "AND"
            }
          ],
          "credits": [
            {
              "lang": "en",
              "type": "reporter",
              "value": "Neil Berkman"
            },
            {
              "lang": "en",
              "type": "finder",
              "value": "Neil Berkman"
            },
            {
              "lang": "en",
              "type": "remediation developer",
              "value": "Neil Berkman"
            },
            {
              "lang": "en",
              "type": "coordinator",
              "value": "Jonatan M\u00e4nnchen / EEF"
            },
            {
              "lang": "en",
              "type": "remediation verifier",
              "value": "Jos\u00e9 Valim"
            }
          ],
          "dateAssigned": "2026-10-22T09:25:19.000Z",
          "descriptions": [
            {
              "lang": "en",
              "supportingMedia": [
                {
                  "base64": false,
                  "type": "text/html",
                  "value": "\u003cp\u003eExternally-Generated Error Message Containing Sensitive Information vulnerability in \u003ccode\u003eplug_crypto\u003c/code\u003e 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 \u003ccode\u003ePlug.Crypto\u003c/code\u003e validates argument types in a function-head guard. A failed guard makes the Erlang VM raise \u003ccode\u003eFunctionClauseError\u003c/code\u003e 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\u0027s \u003ccode\u003erescue\u003c/code\u003e blocks and \u003ccode\u003ePlug.Crypto.prune_args_from_stacktrace/1\u003c/code\u003e 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 \u003ccode\u003ecrash_reason\u003c/code\u003e Logger metadata, which error trackers forward.\u003c/p\u003e\n\u003cp\u003eTwo entry points take request data. \u003ccode\u003ePlug.Crypto.verify/4\u003c/code\u003e exposes the secret key base when the token is neither a binary nor nil, which \u003ccode\u003ePhoenix.Token.verify/4\u003c/code\u003e reaches because it forwards the token unguarded. \u003ccode\u003ePlug.Crypto.secure_compare/2\u003c/code\u003e 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.\u003c/p\u003e\n\u003cp\u003eThis issue affects plug: from 1.6.3 before 1.7.0; plug_crypto: from 1.0.0 before 2.2.1.\u003c/p\u003e"
                },
                {
                  "base64": false,
                  "type": "text/markdown",
                  "value": "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\u0027s `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."
                }
              ],
              "value": "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\u0027s 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."
            }
          ],
          "impacts": [
            {
              "capecId": "CAPEC-54",
              "descriptions": [
                {
                  "lang": "en",
                  "supportingMedia": [
                    {
                      "base64": false,
                      "type": "text/html",
                      "value": "\u003cp\u003eAn unauthenticated attacker sends one request with a wrong-typed parameter, or omits a header, and the secret key base or the compared secret is written into the application log and into \u003ccode\u003ecrash_reason\u003c/code\u003e metadata forwarded to error trackers. Anyone who can read those logs then holds a key sufficient to mint session cookies and tokens under any salt.\u003c/p\u003e"
                    },
                    {
                      "base64": false,
                      "type": "text/markdown",
                      "value": "An unauthenticated attacker sends one request with a wrong-typed parameter, or omits a header, and the secret key base or the compared secret is written into the application log and into `crash_reason` metadata forwarded to error trackers. Anyone who can read those logs then holds a key sufficient to mint session cookies and tokens under any salt."
                    }
                  ],
                  "value": "An unauthenticated attacker sends one request with a wrong-typed parameter, or omits a header, and the secret key base or the compared secret is written into the application log and into crash_reason metadata forwarded to error trackers. Anyone who can read those logs then holds a key sufficient to mint session cookies and tokens under any salt."
                }
              ]
            }
          ],
          "metrics": [
            {
              "cvssV4_0": {
                "Automatable": "NOT_DEFINED",
                "Recovery": "NOT_DEFINED",
                "Safety": "NOT_DEFINED",
                "attackComplexity": "LOW",
                "attackRequirements": "NONE",
                "attackVector": "NETWORK",
                "baseScore": 5.1,
                "baseSeverity": "MEDIUM",
                "privilegesRequired": "HIGH",
                "providerUrgency": "NOT_DEFINED",
                "subAvailabilityImpact": "NONE",
                "subConfidentialityImpact": "NONE",
                "subIntegrityImpact": "NONE",
                "userInteraction": "NONE",
                "valueDensity": "NOT_DEFINED",
                "vectorString": "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",
                "version": "4.0",
                "vulnAvailabilityImpact": "NONE",
                "vulnConfidentialityImpact": "LOW",
                "vulnIntegrityImpact": "NONE",
                "vulnerabilityResponseEffort": "NOT_DEFINED"
              },
              "format": "CVSS",
              "scenarios": [
                {
                  "lang": "en",
                  "value": "GENERAL"
                }
              ]
            }
          ],
          "problemTypes": [
            {
              "descriptions": [
                {
                  "cweId": "CWE-532",
                  "description": "CWE-532 Insertion of Sensitive Information into Log File",
                  "lang": "en",
                  "type": "CWE"
                }
              ]
            }
          ],
          "providerMetadata": {
            "dateUpdated": "2026-10-23T09:56:58.885Z",
            "orgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
            "shortName": "EEF"
          },
          "references": [
            {
              "name": "Secret key base exposed in stack trace arguments on wrong-typed Plug.Crypto arguments",
              "tags": [
                "vendor-advisory",
                "related"
              ],
              "url": "https://github.com/elixir-plug/plug/security/advisories/GHSA-ffw9-w85g-f2vh"
            },
            {
              "name": "EEF CNA record for CVE-2026-105963",
              "tags": [
                "related"
              ],
              "url": "https://cna.erlef.org/cves/CVE-2026-105963.html"
            },
            {
              "name": "OSV record EEF-CVE-2026-105963",
              "tags": [
                "related"
              ],
              "url": "https://osv.dev/vulnerability/EEF-CVE-2026-105963"
            },
            {
              "name": "Introducing commit 56000c3 in elixir-plug/plug",
              "tags": [
                "related"
              ],
              "url": "https://github.com/elixir-plug/plug/commit/56000c33d8a0a2fbac491f8be06b9c5112bc2276"
            },
            {
              "name": "Fix commit aeaa90e in elixir-plug/plug",
              "tags": [
                "patch"
              ],
              "url": "https://github.com/elixir-plug/plug/commit/aeaa90e76b73ea90c3ecca9aae16fce71bd2a8d4"
            },
            {
              "name": "Introducing commit 2d078b7 in elixir-plug/plug_crypto",
              "tags": [
                "related"
              ],
              "url": "https://github.com/elixir-plug/plug_crypto/commit/2d078b7b8264c565f0ff71235c515f4f46882dcf"
            },
            {
              "name": "Fix commit 9818874 in elixir-plug/plug_crypto",
              "tags": [
                "patch"
              ],
              "url": "https://github.com/elixir-plug/plug_crypto/commit/981887493dada0fce7003c61861c00dfbb0fc8c5"
            }
          ],
          "source": {
            "discovery": "EXTERNAL"
          },
          "title": "Secret key base exposed in stack trace arguments on wrong-typed Plug.Crypto arguments",
          "workarounds": [
            {
              "lang": "en",
              "supportingMedia": [
                {
                  "base64": false,
                  "type": "text/html",
                  "value": "\u003cp\u003eCheck argument types in the calling code before entering \u003ccode\u003ePlug.Crypto\u003c/code\u003e, so no head guard ever fails. Pass a token to \u003ccode\u003ePhoenix.Token.verify/4\u003c/code\u003e, \u003ccode\u003ePhoenix.Token.decrypt/4\u003c/code\u003e, \u003ccode\u003ePlug.Crypto.verify/4\u003c/code\u003e or \u003ccode\u003ePlug.Crypto.decrypt/4\u003c/code\u003e only when \u003ccode\u003eis_binary(token)\u003c/code\u003e holds, and treat anything else as an invalid token. Call \u003ccode\u003ePlug.Crypto.secure_compare/2\u003c/code\u003e only when both operands are binaries, treating a missing header or parameter as a failed comparison rather than passing nil.\u003c/p\u003e\n\u003cp\u003eWhere the leaked value matters more than the crash, configuring the error tracker to drop stack-frame arguments also keeps the secret out of the forwarded report. For Sentry this means not sending \u003ccode\u003evars\u003c/code\u003e with the crash report. This narrows exposure but leaves the value in the local error log.\u003c/p\u003e"
                },
                {
                  "base64": false,
                  "type": "text/markdown",
                  "value": "Check argument types in the calling code before entering `Plug.Crypto`, so no head guard ever fails. Pass a token to `Phoenix.Token.verify/4`, `Phoenix.Token.decrypt/4`, `Plug.Crypto.verify/4` or `Plug.Crypto.decrypt/4` only when `is_binary(token)` holds, and treat anything else as an invalid token. Call `Plug.Crypto.secure_compare/2` only when both operands are binaries, treating a missing header or parameter as a failed comparison rather than passing nil.\n\nWhere the leaked value matters more than the crash, configuring the error tracker to drop stack-frame arguments also keeps the secret out of the forwarded report. For Sentry this means not sending `vars` with the crash report. This narrows exposure but leaves the value in the local error log."
                }
              ],
              "value": "Check argument types in the calling code before entering Plug.Crypto, so no head guard ever fails. Pass a token to Phoenix.Token.verify/4, Phoenix.Token.decrypt/4, Plug.Crypto.verify/4 or Plug.Crypto.decrypt/4 only when is_binary(token) holds, and treat anything else as an invalid token. Call Plug.Crypto.secure_compare/2 only when both operands are binaries, treating a missing header or parameter as a failed comparison rather than passing nil.\n\nWhere the leaked value matters more than the crash, configuring the error tracker to drop stack-frame arguments also keeps the secret out of the forwarded report. For Sentry this means not sending vars with the crash report. This narrows exposure but leaves the value in the local error log."
            }
          ],
          "x_proofOfConcept": [
            {
              "lang": "en",
              "supportingMedia": [
                {
                  "base64": false,
                  "type": "text/html",
                  "value": "\u003col\u003e\n\u003cli\u003eRun an application that depends on \u003ccode\u003eplug_crypto\u003c/code\u003e and exposes a route calling \u003ccode\u003ePhoenix.Token.verify(secret_key_base, \"user auth\", conn.params[\"token\"])\u003c/code\u003e, plus a route calling \u003ccode\u003ePlug.Crypto.secure_compare(List.first(get_req_header(conn, \"x-api-key\")), api_key)\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eSend \u003ccode\u003eGET /verify?token[]=x\u003c/code\u003e. \u003ccode\u003ePlug.Parsers\u003c/code\u003e yields a list for the bracket syntax, so the token argument is a list.\u003c/li\u003e\n\u003cli\u003eObserve the 500 response and read the error log. The top frame prints \u003ccode\u003ePlug.Crypto.verify(\"SECRET_KEY_BASE_...\", \"user auth\", [\"x\"], [])\u003c/code\u003e with the secret key base in full, and the same frame is attached as \u003ccode\u003ecrash_reason\u003c/code\u003e Logger metadata.\u003c/li\u003e\n\u003cli\u003eSend \u003ccode\u003eGET /api\u003c/code\u003e with no \u003ccode\u003ex-api-key\u003c/code\u003e header. The header lookup yields nil, and the frame prints \u003ccode\u003ePlug.Crypto.secure_compare(nil, \"\u0026lt;configured API key\u0026gt;\")\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eA JSON body of \u003ccode\u003e{\"token\": 123}\u003c/code\u003e to the first route gives the same result with an integer argument.\u003c/li\u003e\n\u003c/ol\u003e"
                },
                {
                  "base64": false,
                  "type": "text/markdown",
                  "value": "1. Run an application that depends on `plug_crypto` and exposes a route calling `Phoenix.Token.verify(secret_key_base, \"user auth\", conn.params[\"token\"])`, plus a route calling `Plug.Crypto.secure_compare(List.first(get_req_header(conn, \"x-api-key\")), api_key)`.\n2. Send `GET /verify?token[]=x`. `Plug.Parsers` yields a list for the bracket syntax, so the token argument is a list.\n3. Observe the 500 response and read the error log. The top frame prints `Plug.Crypto.verify(\"SECRET_KEY_BASE_...\", \"user auth\", [\"x\"], [])` with the secret key base in full, and the same frame is attached as `crash_reason` Logger metadata.\n4. Send `GET /api` with no `x-api-key` header. The header lookup yields nil, and the frame prints `Plug.Crypto.secure_compare(nil, \"\u003cconfigured API key\u003e\")`.\n5. A JSON body of `{\"token\": 123}` to the first route gives the same result with an integer argument."
                }
              ],
              "value": "* Run an application that depends on plug_crypto and exposes a route calling Phoenix.Token.verify(secret_key_base, \"user auth\", conn.params[\"token\"]), plus a route calling Plug.Crypto.secure_compare(List.first(get_req_header(conn, \"x-api-key\")), api_key).\n* Send GET /verify?token[]=x. Plug.Parsers yields a list for the bracket syntax, so the token argument is a list.\n* Observe the 500 response and read the error log. The top frame prints Plug.Crypto.verify(\"SECRET_KEY_BASE_...\", \"user auth\", [\"x\"], []) with the secret key base in full, and the same frame is attached as crash_reason Logger metadata.\n* Send GET /api with no x-api-key header. The header lookup yields nil, and the frame prints Plug.Crypto.secure_compare(nil, \"\u003cconfigured API key\u003e\").\n* A JSON body of {\"token\": 123} to the first route gives the same result with an integer argument."
            }
          ],
          "x_technicalAnalysis": [
            {
              "lang": "en",
              "supportingMedia": [
                {
                  "base64": false,
                  "type": "text/html",
                  "value": "\u003cp\u003e\u003cstrong\u003e1. Type checks in function-head guards.\u003c/strong\u003e Every public function in \u003ccode\u003ePlug.Crypto\u003c/code\u003e validates its arguments in a head guard, for example \u003ccode\u003esecure_compare/2\u003c/code\u003e with \u003ccode\u003ewhen is_binary(left) and is_binary(right)\u003c/code\u003e and \u003ccode\u003everify/4\u003c/code\u003e with \u003ccode\u003ewhen is_binary(key_base) and is_binary(salt) and is_binary(token)\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e2. The VM builds the error, not the library.\u003c/strong\u003e When no clause matches, the Erlang VM raises \u003ccode\u003eFunctionClauseError\u003c/code\u003e and the top stack frame holds the actual argument values. The library\u0027s \u003ccode\u003erescue ... reraise\u003c/code\u003e blocks and \u003ccode\u003ePlug.Crypto.prune_args_from_stacktrace/1\u003c/code\u003e only apply to exceptions raised inside a function body, so a guard failure never reaches them. In \u003ccode\u003eplug_crypto\u003c/code\u003e the same commit that added \u003ccode\u003eprune_args_from_stacktrace/1\u003c/code\u003e also added these guards.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e3. Which value leaks.\u003c/strong\u003e \u003ccode\u003everify/4\u003c/code\u003e and \u003ccode\u003esign/4\u003c/code\u003e put the secret key base in the frame. \u003ccode\u003edecrypt/4\u003c/code\u003e has no \u003ccode\u003eis_binary(token)\u003c/code\u003e guard on its main clause, so the key is derived first and the failing guard belongs to \u003ccode\u003eMessageEncryptor.decrypt/4\u003c/code\u003e, placing the derived 32-byte key in the frame. \u003ccode\u003esecure_compare/2\u003c/code\u003e places the other operand in the frame, which is the server-side secret when a request value is nil.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e4. The frame reaches logs and error trackers.\u003c/strong\u003e Plug.Cowboy and Bandit write the formatted frame, arguments included, to the error log and attach it as \u003ccode\u003ecrash_reason\u003c/code\u003e Logger metadata. Error trackers forward it; Sentry\u0027s handler sends crash reports by default and serializes frame arguments as \u003ccode\u003evars\u003c/code\u003e.\u003c/p\u003e"
                },
                {
                  "base64": false,
                  "type": "text/markdown",
                  "value": "**1. Type checks in function-head guards.** Every public function in `Plug.Crypto` validates its arguments in a head guard, for example `secure_compare/2` with `when is_binary(left) and is_binary(right)` and `verify/4` with `when is_binary(key_base) and is_binary(salt) and is_binary(token)`.\n\n**2. The VM builds the error, not the library.** When no clause matches, the Erlang VM raises `FunctionClauseError` and the top stack frame holds the actual argument values. The library\u0027s `rescue ... reraise` blocks and `Plug.Crypto.prune_args_from_stacktrace/1` only apply to exceptions raised inside a function body, so a guard failure never reaches them. In `plug_crypto` the same commit that added `prune_args_from_stacktrace/1` also added these guards.\n\n**3. Which value leaks.** `verify/4` and `sign/4` put the secret key base in the frame. `decrypt/4` has no `is_binary(token)` guard on its main clause, so the key is derived first and the failing guard belongs to `MessageEncryptor.decrypt/4`, placing the derived 32-byte key in the frame. `secure_compare/2` places the other operand in the frame, which is the server-side secret when a request value is nil.\n\n**4. The frame reaches logs and error trackers.** Plug.Cowboy and Bandit write the formatted frame, arguments included, to the error log and attach it as `crash_reason` Logger metadata. Error trackers forward it; Sentry\u0027s handler sends crash reports by default and serializes frame arguments as `vars`."
                }
              ],
              "value": "1. Type checks in function-head guards. Every public function in Plug.Crypto validates its arguments in a head guard, for example secure_compare/2 with when is_binary(left) and is_binary(right) and verify/4 with when is_binary(key_base) and is_binary(salt) and is_binary(token).\n\n2. The VM builds the error, not the library. When no clause matches, the Erlang VM raises FunctionClauseError and the top stack frame holds the actual argument values. The library\u0027s rescue ... reraise blocks and Plug.Crypto.prune_args_from_stacktrace/1 only apply to exceptions raised inside a function body, so a guard failure never reaches them. In plug_crypto the same commit that added prune_args_from_stacktrace/1 also added these guards.\n\n3. Which value leaks. verify/4 and sign/4 put the secret key base in the frame. decrypt/4 has no is_binary(token) guard on its main clause, so the key is derived first and the failing guard belongs to MessageEncryptor.decrypt/4, placing the derived 32-byte key in the frame. secure_compare/2 places the other operand in the frame, which is the server-side secret when a request value is nil.\n\n4. The frame reaches logs and error trackers. Plug.Cowboy and Bandit write the formatted frame, arguments included, to the error log and attach it as crash_reason Logger metadata. Error trackers forward it; Sentry\u0027s handler sends crash reports by default and serializes frame arguments as vars."
            }
          ]
        }
      },
      "cveMetadata": {
        "assignerOrgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
        "assignerShortName": "EEF",
        "cveId": "CVE-2026-105963",
        "datePublished": "2026-10-23T09:56:58.885Z",
        "dateReserved": "2026-10-06T10:30:01.805Z",
        "dateUpdated": "2026-10-23T13:39:29.887Z",
        "state": "PUBLISHED"
      },
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }