GCVE Workshop - 22 September 2026 (14:00-18:00), Luxembourg Before The Vulnopticon Conference - Registration

CVE-2026-66838 (GCVE-0-2026-66838)

Vulnerability from cvelistv5 – Published: 2026-08-07 12:20 – Updated: 2026-08-07 15:12
VLAI
Title
SQL injection via the :comment option in Postgrex.stream/4
Summary
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in elixir-ecto postgrex allows SQL Injection via the :comment option of Postgrex.stream/4. An attacker who can influence that value can close the comment delimiter with */ and extend the streamed statement with their own clauses, which execute under the connection's role. Ecto exposes the same option through Ecto.Repo.stream/2. Postgrex appends the comment by concatenating it into the statement text sent in the Parse message, without escaping or rejecting */. The option is validated by comment_not_present!/1 at every other execution point; stream/4 never calls it. Because Parse accepts a single command, the injection is confined to the streamed statement and further statements cannot be chained. This issue affects postgrex: from 0.19.3 before 0.22.4.
SSVC
Exploitation: poc Automatable: no Technical Impact: partial
CISA Coordinator · CISA-ADP (v2.0.3)
Decision recorded 2026-08-07 15:11 UTC
CWE
  • CWE-89 - Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Assigner
Impacted products
Vendor Product Version CPE status
elixir-ecto postgrex Affected: 0.19.3 , < 0.22.4 (semver)
    cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*
Create a notification for this product.
elixir-ecto postgrex Affected: 4971a2722fa72f8e1b54a2c403cad4c43916e36d , < * (git)
    cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*
Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2026-66838",
                "options": [
                  {
                    "Exploitation": "poc"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2026-08-07T15:11:28.060095Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2026-08-07T15:12:12.308Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "references": [
          {
            "tags": [
              "exploit"
            ],
            "url": "https://github.com/elixir-ecto/ecto/security/advisories/GHSA-3gww-3f36-2388"
          }
        ],
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "collectionURL": "https://repo.hex.pm",
          "cpes": [
            "cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*"
          ],
          "defaultStatus": "unaffected",
          "modules": [
            "\u0027Elixir.Postgrex\u0027",
            "\u0027Elixir.Postgrex.Protocol\u0027"
          ],
          "packageName": "postgrex",
          "packageURL": "pkg:hex/postgrex",
          "product": "postgrex",
          "programFiles": [
            "lib/postgrex.ex",
            "lib/postgrex/protocol.ex"
          ],
          "programRoutines": [
            {
              "name": "\u0027Elixir.Postgrex\u0027:stream/4"
            },
            {
              "name": "\u0027Elixir.Postgrex.Protocol\u0027:parse_describe_comment_msgs/3"
            }
          ],
          "repo": "https://github.com/elixir-ecto/postgrex",
          "vendor": "elixir-ecto",
          "versions": [
            {
              "lessThan": "0.22.4",
              "status": "affected",
              "version": "0.19.3",
              "versionType": "semver"
            }
          ]
        },
        {
          "collectionURL": "https://github.com",
          "cpes": [
            "cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*"
          ],
          "defaultStatus": "unaffected",
          "modules": [
            "\u0027Elixir.Postgrex\u0027",
            "\u0027Elixir.Postgrex.Protocol\u0027"
          ],
          "packageName": "elixir-ecto/postgrex",
          "packageURL": "pkg:github/elixir-ecto/postgrex",
          "product": "postgrex",
          "programFiles": [
            "lib/postgrex.ex",
            "lib/postgrex/protocol.ex"
          ],
          "programRoutines": [
            {
              "name": "\u0027Elixir.Postgrex\u0027:stream/4"
            },
            {
              "name": "\u0027Elixir.Postgrex.Protocol\u0027:parse_describe_comment_msgs/3"
            }
          ],
          "repo": "https://github.com/elixir-ecto/postgrex",
          "vendor": "elixir-ecto",
          "versions": [
            {
              "changes": [
                {
                  "at": "e1ecba618ddea4cee2556bd6ad9b6285e05f9d3c",
                  "status": "unaffected"
                },
                {
                  "at": "4011be852c99dc61ddb98cb01aa41e8775a0e3dd",
                  "status": "unaffected"
                }
              ],
              "lessThan": "*",
              "status": "affected",
              "version": "4971a2722fa72f8e1b54a2c403cad4c43916e36d",
              "versionType": "git"
            }
          ]
        }
      ],
      "configurations": [
        {
          "lang": "en",
          "supportingMedia": [
            {
              "base64": false,
              "type": "text/html",
              "value": "\u003cp\u003eThe application must pass a \u003ccode\u003e:comment\u003c/code\u003e derived from untrusted input to \u003ccode\u003ePostgrex.stream/4\u003c/code\u003e or \u003ccode\u003eEcto.Repo.stream/2\u003c/code\u003e. Applications that omit the option or pass only static values are unaffected.\u003c/p\u003e"
            },
            {
              "base64": false,
              "type": "text/markdown",
              "value": "The application must pass a `:comment` derived from untrusted input to `Postgrex.stream/4` or `Ecto.Repo.stream/2`. Applications that omit the option or pass only static values are unaffected."
            }
          ],
          "value": "The application must pass a :comment derived from untrusted input to Postgrex.stream/4 or Ecto.Repo.stream/2. Applications that omit the option or pass only static values are unaffected."
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "0.22.4",
                  "versionStartIncluding": "0.19.3",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ],
          "operator": "AND"
        }
      ],
      "credits": [
        {
          "lang": "en",
          "type": "finder",
          "value": "Snehil Shah"
        },
        {
          "lang": "en",
          "type": "remediation developer",
          "value": "Jos\u00e9 Valim"
        },
        {
          "lang": "en",
          "type": "analyst",
          "value": "Jonatan M\u00e4nnchen / EEF"
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "supportingMedia": [
            {
              "base64": false,
              "type": "text/html",
              "value": "\u003cp\u003eImproper Neutralization of Special Elements used in an SQL Command (\u0027SQL Injection\u0027) vulnerability in elixir-ecto postgrex allows SQL Injection via the \u003ccode\u003e:comment\u003c/code\u003e option of \u003ccode\u003ePostgrex.stream/4\u003c/code\u003e. An attacker who can influence that value can close the comment delimiter with \u003ccode\u003e*/\u003c/code\u003e and extend the streamed statement with their own clauses, which execute under the connection\u0027s role. Ecto exposes the same option through \u003ccode\u003eEcto.Repo.stream/2\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003ePostgrex appends the comment by concatenating it into the statement text sent in the \u003ccode\u003eParse\u003c/code\u003e message, without escaping or rejecting \u003ccode\u003e*/\u003c/code\u003e. The option is validated by \u003ccode\u003ecomment_not_present!/1\u003c/code\u003e at every other execution point; \u003ccode\u003estream/4\u003c/code\u003e never calls it. Because \u003ccode\u003eParse\u003c/code\u003e accepts a single command, the injection is confined to the streamed statement and further statements cannot be chained.\u003c/p\u003e\n\u003cp\u003eThis issue affects postgrex: from 0.19.3 before 0.22.4.\u003c/p\u003e"
            },
            {
              "base64": false,
              "type": "text/markdown",
              "value": "Improper Neutralization of Special Elements used in an SQL Command (\u0027SQL Injection\u0027) vulnerability in elixir-ecto postgrex allows SQL Injection via the `:comment` option of `Postgrex.stream/4`. An attacker who can influence that value can close the comment delimiter with `*/` and extend the streamed statement with their own clauses, which execute under the connection\u0027s role. Ecto exposes the same option through `Ecto.Repo.stream/2`.\n\nPostgrex appends the comment by concatenating it into the statement text sent in the `Parse` message, without escaping or rejecting `*/`. The option is validated by `comment_not_present!/1` at every other execution point; `stream/4` never calls it. Because `Parse` accepts a single command, the injection is confined to the streamed statement and further statements cannot be chained.\n\nThis issue affects postgrex: from 0.19.3 before 0.22.4."
            }
          ],
          "value": "Improper Neutralization of Special Elements used in an SQL Command (\u0027SQL Injection\u0027) vulnerability in elixir-ecto postgrex allows SQL Injection via the :comment option of Postgrex.stream/4. An attacker who can influence that value can close the comment delimiter with */ and extend the streamed statement with their own clauses, which execute under the connection\u0027s role. Ecto exposes the same option through Ecto.Repo.stream/2.\n\nPostgrex appends the comment by concatenating it into the statement text sent in the Parse message, without escaping or rejecting */. The option is validated by comment_not_present!/1 at every other execution point; stream/4 never calls it. Because Parse accepts a single command, the injection is confined to the streamed statement and further statements cannot be chained.\n\nThis issue affects postgrex: from 0.19.3 before 0.22.4."
        }
      ],
      "impacts": [
        {
          "capecId": "CAPEC-66",
          "descriptions": [
            {
              "lang": "en",
              "value": "CAPEC-66 SQL Injection"
            }
          ]
        }
      ],
      "metrics": [
        {
          "cvssV4_0": {
            "Automatable": "NOT_DEFINED",
            "Recovery": "NOT_DEFINED",
            "Safety": "NOT_DEFINED",
            "attackComplexity": "LOW",
            "attackRequirements": "PRESENT",
            "attackVector": "LOCAL",
            "baseScore": 5.9,
            "baseSeverity": "MEDIUM",
            "privilegesRequired": "NONE",
            "providerUrgency": "NOT_DEFINED",
            "subAvailabilityImpact": "NONE",
            "subConfidentialityImpact": "NONE",
            "subIntegrityImpact": "NONE",
            "userInteraction": "NONE",
            "valueDensity": "NOT_DEFINED",
            "vectorString": "CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N",
            "version": "4.0",
            "vulnAvailabilityImpact": "NONE",
            "vulnConfidentialityImpact": "HIGH",
            "vulnIntegrityImpact": "LOW",
            "vulnerabilityResponseEffort": "NOT_DEFINED"
          },
          "format": "CVSS",
          "scenarios": [
            {
              "lang": "en",
              "value": "GENERAL"
            }
          ]
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "cweId": "CWE-89",
              "description": "CWE-89 Improper Neutralization of Special Elements used in an SQL Command (\u0027SQL Injection\u0027)",
              "lang": "en",
              "type": "CWE"
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-07T12:20:02.376Z",
        "orgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
        "shortName": "EEF"
      },
      "references": [
        {
          "tags": [
            "vendor-advisory",
            "related"
          ],
          "url": "https://github.com/elixir-ecto/ecto/security/advisories/GHSA-3gww-3f36-2388"
        },
        {
          "tags": [
            "related"
          ],
          "url": "https://cna.erlef.org/cves/CVE-2026-66838.html"
        },
        {
          "tags": [
            "related"
          ],
          "url": "https://osv.dev/vulnerability/EEF-CVE-2026-66838"
        },
        {
          "tags": [
            "patch"
          ],
          "url": "https://github.com/elixir-ecto/postgrex/commit/e1ecba618ddea4cee2556bd6ad9b6285e05f9d3c"
        },
        {
          "tags": [
            "patch"
          ],
          "url": "https://github.com/elixir-ecto/postgrex/commit/4011be852c99dc61ddb98cb01aa41e8775a0e3dd"
        }
      ],
      "source": {
        "discovery": "EXTERNAL"
      },
      "title": "SQL injection via the :comment option in Postgrex.stream/4",
      "workarounds": [
        {
          "lang": "en",
          "supportingMedia": [
            {
              "base64": false,
              "type": "text/html",
              "value": "\u003cp\u003eReject any \u003ccode\u003e:comment\u003c/code\u003e value containing \u003ccode\u003e*/\u003c/code\u003e or a null byte before passing it to \u003ccode\u003ePostgrex.stream/4\u003c/code\u003e or \u003ccode\u003eEcto.Repo.stream/2\u003c/code\u003e. Alternatively, build comments only from trusted values.\u003c/p\u003e"
            },
            {
              "base64": false,
              "type": "text/markdown",
              "value": "Reject any `:comment` value containing `*/` or a null byte before passing it to `Postgrex.stream/4` or `Ecto.Repo.stream/2`. Alternatively, build comments only from trusted values."
            }
          ],
          "value": "Reject any :comment value containing */ or a null byte before passing it to Postgrex.stream/4 or Ecto.Repo.stream/2. Alternatively, build comments only from trusted values."
        }
      ]
    }
  },
  "cveMetadata": {
    "assignerOrgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
    "assignerShortName": "EEF",
    "cveId": "CVE-2026-66838",
    "datePublished": "2026-08-07T12:20:02.376Z",
    "dateReserved": "2026-08-06T14:00:01.865Z",
    "dateUpdated": "2026-08-07T15:12:12.308Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2026-66838",
      "date": "2026-09-17",
      "epss": "0.00285",
      "percentile": "0.21088"
    },
    "nvd": "{\"cve\":{\"id\":\"CVE-2026-66838\",\"sourceIdentifier\":\"6b3ad84c-e1a6-4bf7-a703-f496b71e49db\",\"published\":\"2026-08-07T13:16:52.960\",\"lastModified\":\"2026-08-17T14:40:45.317\",\"vulnStatus\":\"Analyzed\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"Improper Neutralization of Special Elements used in an SQL Command (\u0027SQL Injection\u0027) vulnerability in elixir-ecto postgrex allows SQL Injection via the :comment option of Postgrex.stream/4. An attacker who can influence that value can close the comment delimiter with */ and extend the streamed statement with their own clauses, which execute under the connection\u0027s role. Ecto exposes the same option through Ecto.Repo.stream/2.\\n\\nPostgrex appends the comment by concatenating it into the statement text sent in the Parse message, without escaping or rejecting */. The option is validated by comment_not_present!/1 at every other execution point; stream/4 never calls it. Because Parse accepts a single command, the injection is confined to the streamed statement and further statements cannot be chained.\\n\\nThis issue affects postgrex: from 0.19.3 before 0.22.4.\"}],\"affected\":[{\"source\":\"6b3ad84c-e1a6-4bf7-a703-f496b71e49db\",\"affectedData\":[{\"vendor\":\"elixir-ecto\",\"product\":\"postgrex\",\"defaultStatus\":\"unaffected\",\"collectionURL\":\"https://repo.hex.pm\",\"packageName\":\"postgrex\",\"cpes\":[\"cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*\"],\"modules\":[\"\u0027Elixir.Postgrex\u0027\",\"\u0027Elixir.Postgrex.Protocol\u0027\"],\"programFiles\":[\"lib/postgrex.ex\",\"lib/postgrex/protocol.ex\"],\"programRoutines\":[{\"name\":\"\u0027Elixir.Postgrex\u0027:stream/4\"},{\"name\":\"\u0027Elixir.Postgrex.Protocol\u0027:parse_describe_comment_msgs/3\"}],\"repo\":\"https://github.com/elixir-ecto/postgrex\",\"packageURL\":\"pkg:hex/postgrex\",\"versions\":[{\"version\":\"0.19.3\",\"lessThan\":\"0.22.4\",\"versionType\":\"semver\",\"status\":\"affected\"}]},{\"vendor\":\"elixir-ecto\",\"product\":\"postgrex\",\"defaultStatus\":\"unaffected\",\"collectionURL\":\"https://github.com\",\"packageName\":\"elixir-ecto/postgrex\",\"cpes\":[\"cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*\"],\"modules\":[\"\u0027Elixir.Postgrex\u0027\",\"\u0027Elixir.Postgrex.Protocol\u0027\"],\"programFiles\":[\"lib/postgrex.ex\",\"lib/postgrex/protocol.ex\"],\"programRoutines\":[{\"name\":\"\u0027Elixir.Postgrex\u0027:stream/4\"},{\"name\":\"\u0027Elixir.Postgrex.Protocol\u0027:parse_describe_comment_msgs/3\"}],\"repo\":\"https://github.com/elixir-ecto/postgrex\",\"packageURL\":\"pkg:github/elixir-ecto/postgrex\",\"versions\":[{\"version\":\"4971a2722fa72f8e1b54a2c403cad4c43916e36d\",\"lessThan\":\"*\",\"versionType\":\"git\",\"status\":\"affected\",\"changes\":[{\"at\":\"e1ecba618ddea4cee2556bd6ad9b6285e05f9d3c\",\"status\":\"unaffected\"},{\"at\":\"4011be852c99dc61ddb98cb01aa41e8775a0e3dd\",\"status\":\"unaffected\"}]}]}]}],\"metrics\":{\"cvssMetricV40\":[{\"source\":\"6b3ad84c-e1a6-4bf7-a703-f496b71e49db\",\"type\":\"Secondary\",\"cvssData\":{\"version\":\"4.0\",\"vectorString\":\"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:L/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\",\"baseScore\":5.9,\"baseSeverity\":\"MEDIUM\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"attackRequirements\":\"PRESENT\",\"privilegesRequired\":\"NONE\",\"userInteraction\":\"NONE\",\"vulnConfidentialityImpact\":\"HIGH\",\"vulnIntegrityImpact\":\"LOW\",\"vulnAvailabilityImpact\":\"NONE\",\"subConfidentialityImpact\":\"NONE\",\"subIntegrityImpact\":\"NONE\",\"subAvailabilityImpact\":\"NONE\",\"exploitMaturity\":\"NOT_DEFINED\",\"confidentialityRequirement\":\"NOT_DEFINED\",\"integrityRequirement\":\"NOT_DEFINED\",\"availabilityRequirement\":\"NOT_DEFINED\",\"modifiedAttackVector\":\"NOT_DEFINED\",\"modifiedAttackComplexity\":\"NOT_DEFINED\",\"modifiedAttackRequirements\":\"NOT_DEFINED\",\"modifiedPrivilegesRequired\":\"NOT_DEFINED\",\"modifiedUserInteraction\":\"NOT_DEFINED\",\"modifiedVulnConfidentialityImpact\":\"NOT_DEFINED\",\"modifiedVulnIntegrityImpact\":\"NOT_DEFINED\",\"modifiedVulnAvailabilityImpact\":\"NOT_DEFINED\",\"modifiedSubConfidentialityImpact\":\"NOT_DEFINED\",\"modifiedSubIntegrityImpact\":\"NOT_DEFINED\",\"modifiedSubAvailabilityImpact\":\"NOT_DEFINED\",\"Safety\":\"NOT_DEFINED\",\"Automatable\":\"NOT_DEFINED\",\"Recovery\":\"NOT_DEFINED\",\"valueDensity\":\"NOT_DEFINED\",\"vulnerabilityResponseEffort\":\"NOT_DEFINED\",\"providerUrgency\":\"NOT_DEFINED\"}}],\"cvssMetricV31\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N\",\"baseScore\":8.2,\"baseSeverity\":\"HIGH\",\"attackVector\":\"NETWORK\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"NONE\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"HIGH\",\"integrityImpact\":\"LOW\",\"availabilityImpact\":\"NONE\"},\"exploitabilityScore\":3.9,\"impactScore\":4.2}],\"ssvcV203\":[{\"source\":\"134c704f-9b21-4f2e-91b3-4a467353bcc0\",\"ssvcData\":{\"timestamp\":\"2026-08-07T15:11:28.060095Z\",\"id\":\"CVE-2026-66838\",\"options\":[{\"exploitation\":\"poc\"},{\"automatable\":\"no\"},{\"technicalImpact\":\"partial\"}],\"role\":\"CISA Coordinator\",\"version\":\"2.0.3\"}}]},\"weaknesses\":[{\"source\":\"6b3ad84c-e1a6-4bf7-a703-f496b71e49db\",\"type\":\"Secondary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-89\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"0.19.3\",\"versionEndExcluding\":\"0.22.4\",\"matchCriteriaId\":\"15B08735-414F-4252-9357-F1CA4081CAF5\"}]}]}],\"references\":[{\"url\":\"https://cna.erlef.org/cves/CVE-2026-66838.html\",\"source\":\"6b3ad84c-e1a6-4bf7-a703-f496b71e49db\",\"tags\":[\"Patch\",\"Third Party Advisory\"]},{\"url\":\"https://github.com/elixir-ecto/ecto/security/advisories/GHSA-3gww-3f36-2388\",\"source\":\"6b3ad84c-e1a6-4bf7-a703-f496b71e49db\",\"tags\":[\"Exploit\",\"Patch\",\"Vendor Advisory\"]},{\"url\":\"https://github.com/elixir-ecto/postgrex/commit/4011be852c99dc61ddb98cb01aa41e8775a0e3dd\",\"source\":\"6b3ad84c-e1a6-4bf7-a703-f496b71e49db\",\"tags\":[\"Patch\"]},{\"url\":\"https://github.com/elixir-ecto/postgrex/commit/e1ecba618ddea4cee2556bd6ad9b6285e05f9d3c\",\"source\":\"6b3ad84c-e1a6-4bf7-a703-f496b71e49db\",\"tags\":[\"Patch\"]},{\"url\":\"https://osv.dev/vulnerability/EEF-CVE-2026-66838\",\"source\":\"6b3ad84c-e1a6-4bf7-a703-f496b71e49db\",\"tags\":[\"Patch\",\"Third Party Advisory\"]},{\"url\":\"https://github.com/elixir-ecto/ecto/security/advisories/GHSA-3gww-3f36-2388\",\"source\":\"134c704f-9b21-4f2e-91b3-4a467353bcc0\",\"tags\":[\"Exploit\",\"Patch\",\"Vendor Advisory\"]}]}}",
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2026-66838\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"poc\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2026-08-07T15:11:28.060095Z\"}}}], \"references\": [{\"url\": \"https://github.com/elixir-ecto/ecto/security/advisories/GHSA-3gww-3f36-2388\", \"tags\": [\"exploit\"]}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2026-08-07T15:12:07.776Z\"}}], \"cna\": {\"title\": \"SQL injection via the :comment option in Postgrex.stream/4\", \"source\": {\"discovery\": \"EXTERNAL\"}, \"credits\": [{\"lang\": \"en\", \"type\": \"finder\", \"value\": \"Snehil Shah\"}, {\"lang\": \"en\", \"type\": \"remediation developer\", \"value\": \"Jos\\u00e9 Valim\"}, {\"lang\": \"en\", \"type\": \"analyst\", \"value\": \"Jonatan M\\u00e4nnchen / EEF\"}], \"impacts\": [{\"capecId\": \"CAPEC-66\", \"descriptions\": [{\"lang\": \"en\", \"value\": \"CAPEC-66 SQL Injection\"}]}], \"metrics\": [{\"format\": \"CVSS\", \"cvssV4_0\": {\"Safety\": \"NOT_DEFINED\", \"version\": \"4.0\", \"Recovery\": \"NOT_DEFINED\", \"baseScore\": 5.9, \"Automatable\": \"NOT_DEFINED\", \"attackVector\": \"LOCAL\", \"baseSeverity\": \"MEDIUM\", \"valueDensity\": \"NOT_DEFINED\", \"vectorString\": \"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N\", \"providerUrgency\": \"NOT_DEFINED\", \"userInteraction\": \"NONE\", \"attackComplexity\": \"LOW\", \"attackRequirements\": \"PRESENT\", \"privilegesRequired\": \"NONE\", \"subIntegrityImpact\": \"NONE\", \"vulnIntegrityImpact\": \"LOW\", \"subAvailabilityImpact\": \"NONE\", \"vulnAvailabilityImpact\": \"NONE\", \"subConfidentialityImpact\": \"NONE\", \"vulnConfidentialityImpact\": \"HIGH\", \"vulnerabilityResponseEffort\": \"NOT_DEFINED\"}, \"scenarios\": [{\"lang\": \"en\", \"value\": \"GENERAL\"}]}], \"affected\": [{\"cpes\": [\"cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*\"], \"repo\": \"https://github.com/elixir-ecto/postgrex\", \"vendor\": \"elixir-ecto\", \"modules\": [\"\u0027Elixir.Postgrex\u0027\", \"\u0027Elixir.Postgrex.Protocol\u0027\"], \"product\": \"postgrex\", \"versions\": [{\"status\": \"affected\", \"version\": \"0.19.3\", \"lessThan\": \"0.22.4\", \"versionType\": \"semver\"}], \"packageURL\": \"pkg:hex/postgrex\", \"packageName\": \"postgrex\", \"programFiles\": [\"lib/postgrex.ex\", \"lib/postgrex/protocol.ex\"], \"collectionURL\": \"https://repo.hex.pm\", \"defaultStatus\": \"unaffected\", \"programRoutines\": [{\"name\": \"\u0027Elixir.Postgrex\u0027:stream/4\"}, {\"name\": \"\u0027Elixir.Postgrex.Protocol\u0027:parse_describe_comment_msgs/3\"}]}, {\"cpes\": [\"cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*\"], \"repo\": \"https://github.com/elixir-ecto/postgrex\", \"vendor\": \"elixir-ecto\", \"modules\": [\"\u0027Elixir.Postgrex\u0027\", \"\u0027Elixir.Postgrex.Protocol\u0027\"], \"product\": \"postgrex\", \"versions\": [{\"status\": \"affected\", \"changes\": [{\"at\": \"e1ecba618ddea4cee2556bd6ad9b6285e05f9d3c\", \"status\": \"unaffected\"}, {\"at\": \"4011be852c99dc61ddb98cb01aa41e8775a0e3dd\", \"status\": \"unaffected\"}], \"version\": \"4971a2722fa72f8e1b54a2c403cad4c43916e36d\", \"lessThan\": \"*\", \"versionType\": \"git\"}], \"packageURL\": \"pkg:github/elixir-ecto/postgrex\", \"packageName\": \"elixir-ecto/postgrex\", \"programFiles\": [\"lib/postgrex.ex\", \"lib/postgrex/protocol.ex\"], \"collectionURL\": \"https://github.com\", \"defaultStatus\": \"unaffected\", \"programRoutines\": [{\"name\": \"\u0027Elixir.Postgrex\u0027:stream/4\"}, {\"name\": \"\u0027Elixir.Postgrex.Protocol\u0027:parse_describe_comment_msgs/3\"}]}], \"references\": [{\"url\": \"https://github.com/elixir-ecto/ecto/security/advisories/GHSA-3gww-3f36-2388\", \"tags\": [\"vendor-advisory\", \"related\"]}, {\"url\": \"https://cna.erlef.org/cves/CVE-2026-66838.html\", \"tags\": [\"related\"]}, {\"url\": \"https://osv.dev/vulnerability/EEF-CVE-2026-66838\", \"tags\": [\"related\"]}, {\"url\": \"https://github.com/elixir-ecto/postgrex/commit/e1ecba618ddea4cee2556bd6ad9b6285e05f9d3c\", \"tags\": [\"patch\"]}, {\"url\": \"https://github.com/elixir-ecto/postgrex/commit/4011be852c99dc61ddb98cb01aa41e8775a0e3dd\", \"tags\": [\"patch\"]}], \"workarounds\": [{\"lang\": \"en\", \"value\": \"Reject any :comment value containing */ or a null byte before passing it to Postgrex.stream/4 or Ecto.Repo.stream/2. Alternatively, build comments only from trusted values.\", \"supportingMedia\": [{\"type\": \"text/html\", \"value\": \"\u003cp\u003eReject any \u003ccode\u003e:comment\u003c/code\u003e value containing \u003ccode\u003e*/\u003c/code\u003e or a null byte before passing it to \u003ccode\u003ePostgrex.stream/4\u003c/code\u003e or \u003ccode\u003eEcto.Repo.stream/2\u003c/code\u003e. Alternatively, build comments only from trusted values.\u003c/p\u003e\", \"base64\": false}, {\"type\": \"text/markdown\", \"value\": \"Reject any `:comment` value containing `*/` or a null byte before passing it to `Postgrex.stream/4` or `Ecto.Repo.stream/2`. Alternatively, build comments only from trusted values.\", \"base64\": false}]}], \"descriptions\": [{\"lang\": \"en\", \"value\": \"Improper Neutralization of Special Elements used in an SQL Command (\u0027SQL Injection\u0027) vulnerability in elixir-ecto postgrex allows SQL Injection via the :comment option of Postgrex.stream/4. An attacker who can influence that value can close the comment delimiter with */ and extend the streamed statement with their own clauses, which execute under the connection\u0027s role. Ecto exposes the same option through Ecto.Repo.stream/2.\\n\\nPostgrex appends the comment by concatenating it into the statement text sent in the Parse message, without escaping or rejecting */. The option is validated by comment_not_present!/1 at every other execution point; stream/4 never calls it. Because Parse accepts a single command, the injection is confined to the streamed statement and further statements cannot be chained.\\n\\nThis issue affects postgrex: from 0.19.3 before 0.22.4.\", \"supportingMedia\": [{\"type\": \"text/html\", \"value\": \"\u003cp\u003eImproper Neutralization of Special Elements used in an SQL Command (\u0027SQL Injection\u0027) vulnerability in elixir-ecto postgrex allows SQL Injection via the \u003ccode\u003e:comment\u003c/code\u003e option of \u003ccode\u003ePostgrex.stream/4\u003c/code\u003e. An attacker who can influence that value can close the comment delimiter with \u003ccode\u003e*/\u003c/code\u003e and extend the streamed statement with their own clauses, which execute under the connection\u0027s role. Ecto exposes the same option through \u003ccode\u003eEcto.Repo.stream/2\u003c/code\u003e.\u003c/p\u003e\\n\u003cp\u003ePostgrex appends the comment by concatenating it into the statement text sent in the \u003ccode\u003eParse\u003c/code\u003e message, without escaping or rejecting \u003ccode\u003e*/\u003c/code\u003e. The option is validated by \u003ccode\u003ecomment_not_present!/1\u003c/code\u003e at every other execution point; \u003ccode\u003estream/4\u003c/code\u003e never calls it. Because \u003ccode\u003eParse\u003c/code\u003e accepts a single command, the injection is confined to the streamed statement and further statements cannot be chained.\u003c/p\u003e\\n\u003cp\u003eThis issue affects postgrex: from 0.19.3 before 0.22.4.\u003c/p\u003e\", \"base64\": false}, {\"type\": \"text/markdown\", \"value\": \"Improper Neutralization of Special Elements used in an SQL Command (\u0027SQL Injection\u0027) vulnerability in elixir-ecto postgrex allows SQL Injection via the `:comment` option of `Postgrex.stream/4`. An attacker who can influence that value can close the comment delimiter with `*/` and extend the streamed statement with their own clauses, which execute under the connection\u0027s role. Ecto exposes the same option through `Ecto.Repo.stream/2`.\\n\\nPostgrex appends the comment by concatenating it into the statement text sent in the `Parse` message, without escaping or rejecting `*/`. The option is validated by `comment_not_present!/1` at every other execution point; `stream/4` never calls it. Because `Parse` accepts a single command, the injection is confined to the streamed statement and further statements cannot be chained.\\n\\nThis issue affects postgrex: from 0.19.3 before 0.22.4.\", \"base64\": false}]}], \"problemTypes\": [{\"descriptions\": [{\"lang\": \"en\", \"type\": \"CWE\", \"cweId\": \"CWE-89\", \"description\": \"CWE-89 Improper Neutralization of Special Elements used in an SQL Command (\u0027SQL Injection\u0027)\"}]}], \"configurations\": [{\"lang\": \"en\", \"value\": \"The application must pass a :comment derived from untrusted input to Postgrex.stream/4 or Ecto.Repo.stream/2. Applications that omit the option or pass only static values are unaffected.\", \"supportingMedia\": [{\"type\": \"text/html\", \"value\": \"\u003cp\u003eThe application must pass a \u003ccode\u003e:comment\u003c/code\u003e derived from untrusted input to \u003ccode\u003ePostgrex.stream/4\u003c/code\u003e or \u003ccode\u003eEcto.Repo.stream/2\u003c/code\u003e. Applications that omit the option or pass only static values are unaffected.\u003c/p\u003e\", \"base64\": false}, {\"type\": \"text/markdown\", \"value\": \"The application must pass a `:comment` derived from untrusted input to `Postgrex.stream/4` or `Ecto.Repo.stream/2`. Applications that omit the option or pass only static values are unaffected.\", \"base64\": false}]}], \"cpeApplicability\": [{\"nodes\": [{\"negate\": false, \"cpeMatch\": [{\"criteria\": \"cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"0.22.4\", \"versionStartIncluding\": \"0.19.3\"}], \"operator\": \"OR\"}], \"operator\": \"AND\"}], \"providerMetadata\": {\"orgId\": \"6b3ad84c-e1a6-4bf7-a703-f496b71e49db\", \"shortName\": \"EEF\", \"dateUpdated\": \"2026-08-07T12:20:02.376Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2026-66838\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2026-08-07T15:12:12.308Z\", \"dateReserved\": \"2026-08-06T14:00:01.865Z\", \"assignerOrgId\": \"6b3ad84c-e1a6-4bf7-a703-f496b71e49db\", \"datePublished\": \"2026-08-07T12:20:02.376Z\", \"assignerShortName\": \"EEF\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…