CVE-2026-66838 (GCVE-0-2026-66838)
Vulnerability from cvelistv5 – Published: 2026-08-07 12:20 – Updated: 2026-08-07 15:12
VLAI
EPSS
VEX
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.
Severity
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
References
5 references
| URL | Tags |
|---|---|
| https://github.com/elixir-ecto/ecto/security/advi… | vendor-advisoryrelated |
| https://cna.erlef.org/cves/CVE-2026-66838.html | related |
| https://osv.dev/vulnerability/EEF-CVE-2026-66838 | related |
| https://github.com/elixir-ecto/postgrex/commit/e1… | patch |
| https://github.com/elixir-ecto/postgrex/commit/40… | patch |
Impacted products
2 products
| Vendor | Product | Version | CPE status | |
|---|---|---|---|---|
| elixir-ecto | postgrex |
Affected:
0.19.3 , < 0.22.4
(semver)
cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:* |
||
| elixir-ecto | postgrex |
Affected:
4971a2722fa72f8e1b54a2c403cad4c43916e36d , < *
(git)
cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:* |
{
"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-29",
"epss": "0.00403",
"percentile": "0.31943"
},
"nvd": {
"cve": {
"affected": [
{
"affectedData": [
{
"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"
}
]
}
],
"source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db"
}
],
"configurations": [
{
"nodes": [
{
"cpeMatch": [
{
"criteria": "cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*",
"matchCriteriaId": "15B08735-414F-4252-9357-F1CA4081CAF5",
"versionEndExcluding": "0.22.4",
"versionStartIncluding": "0.19.3",
"vulnerable": true
}
],
"negate": false,
"operator": "OR"
}
]
}
],
"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."
}
],
"id": "CVE-2026-66838",
"lastModified": "2026-08-17T14:40:45.317",
"metrics": {
"cvssMetricV31": [
{
"cvssData": {
"attackComplexity": "LOW",
"attackVector": "NETWORK",
"availabilityImpact": "NONE",
"baseScore": 8.2,
"baseSeverity": "HIGH",
"confidentialityImpact": "HIGH",
"integrityImpact": "LOW",
"privilegesRequired": "NONE",
"scope": "UNCHANGED",
"userInteraction": "NONE",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N",
"version": "3.1"
},
"exploitabilityScore": 3.9,
"impactScore": 4.2,
"source": "nvd@nist.gov",
"type": "Primary"
}
],
"cvssMetricV40": [
{
"cvssData": {
"Automatable": "NOT_DEFINED",
"Recovery": "NOT_DEFINED",
"Safety": "NOT_DEFINED",
"attackComplexity": "LOW",
"attackRequirements": "PRESENT",
"attackVector": "LOCAL",
"availabilityRequirement": "NOT_DEFINED",
"baseScore": 5.9,
"baseSeverity": "MEDIUM",
"confidentialityRequirement": "NOT_DEFINED",
"exploitMaturity": "NOT_DEFINED",
"integrityRequirement": "NOT_DEFINED",
"modifiedAttackComplexity": "NOT_DEFINED",
"modifiedAttackRequirements": "NOT_DEFINED",
"modifiedAttackVector": "NOT_DEFINED",
"modifiedPrivilegesRequired": "NOT_DEFINED",
"modifiedSubAvailabilityImpact": "NOT_DEFINED",
"modifiedSubConfidentialityImpact": "NOT_DEFINED",
"modifiedSubIntegrityImpact": "NOT_DEFINED",
"modifiedUserInteraction": "NOT_DEFINED",
"modifiedVulnAvailabilityImpact": "NOT_DEFINED",
"modifiedVulnConfidentialityImpact": "NOT_DEFINED",
"modifiedVulnIntegrityImpact": "NOT_DEFINED",
"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/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",
"version": "4.0",
"vulnAvailabilityImpact": "NONE",
"vulnConfidentialityImpact": "HIGH",
"vulnIntegrityImpact": "LOW",
"vulnerabilityResponseEffort": "NOT_DEFINED"
},
"source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"type": "Secondary"
}
],
"ssvcV203": [
{
"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"ssvcData": {
"id": "CVE-2026-66838",
"options": [
{
"exploitation": "poc"
},
{
"automatable": "no"
},
{
"technicalImpact": "partial"
}
],
"role": "CISA Coordinator",
"timestamp": "2026-08-07T15:11:28.060095Z",
"version": "2.0.3"
}
}
]
},
"published": "2026-08-07T13:16:52.960",
"references": [
{
"source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"tags": [
"Patch",
"Third Party Advisory"
],
"url": "https://cna.erlef.org/cves/CVE-2026-66838.html"
},
{
"source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"tags": [
"Exploit",
"Patch",
"Vendor Advisory"
],
"url": "https://github.com/elixir-ecto/ecto/security/advisories/GHSA-3gww-3f36-2388"
},
{
"source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"tags": [
"Patch"
],
"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",
"Third Party Advisory"
],
"url": "https://osv.dev/vulnerability/EEF-CVE-2026-66838"
},
{
"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"tags": [
"Exploit",
"Patch",
"Vendor Advisory"
],
"url": "https://github.com/elixir-ecto/ecto/security/advisories/GHSA-3gww-3f36-2388"
}
],
"sourceIdentifier": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"vulnStatus": "Analyzed",
"weaknesses": [
{
"description": [
{
"lang": "en",
"value": "CWE-89"
}
],
"source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"type": "Secondary"
}
]
}
},
"vulnrichment": {
"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:07.776Z",
"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"
}
}
}
Loading…
Loading…
Experimental. This forecast is provided for visualization only and may change without notice. Do not use it for operational decisions.
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…
Loading…
The MITRE ATT&CK techniques below are AI-generated suggestions, inferred from the description of the
vulnerability by the CIRCL/vulnerability-attack-technique-classification-roberta-base
model, served locally by ML-Gateway.
They have not been verified by an analyst and are provided for guidance only.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
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…