CVE-2026-66838
Full vulnerability record from the local CVENow database.
Description
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.
View original CVE JSON
{
"id": "CVE-2026-66838",
"sourceIdentifier": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"published": "2026-08-07T13:16:52.960",
"lastModified": "2026-10-24T16:10:00.153",
"vulnStatus": "Analyzed",
"cveTags": [],
"descriptions": [
{
"lang": "en",
"value": "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.\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."
},
{
"lang": "es",
"value": "Vulnerabilidad de Neutralización Incorrecta de Elementos Especiales utilizados en un Comando SQL (’inyección SQL’) en elixir-ecto postgrex permite la inyección SQL a través de la opción :comment de Postgrex.stream/4. Un atacante que puede influir en ese valor puede cerrar el delimitador de comentario con */ y extender la declaración transmitida con sus propias cláusulas, las cuales se ejecutan bajo el rol de la conexión. Ecto expone la misma opción a través de Ecto.Repo.stream/2.\n\nPostgrex añade el comentario concatenándolo en el texto de la declaración enviado en el mensaje Parse, sin escapar o rechazar */. La opción es validada por comment_not_present!/1 en cualquier otro punto de ejecución; stream/4 nunca la llama. Debido a que Parse acepta un solo comando, la inyección se limita a la declaración transmitida y no se pueden encadenar declaraciones adicionales.\n\nEste problema afecta a postgrex: desde 0.19.3 antes de 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": [
"'Elixir.Postgrex'",
"'Elixir.Postgrex.Protocol'"
],
"programFiles": [
"lib/postgrex.ex",
"lib/postgrex/protocol.ex"
],
"programRoutines": [
{
"name": "'Elixir.Postgrex':stream/4"
},
{
"name": "'Elixir.Postgrex.Protocol':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": [
"'Elixir.Postgrex'",
"'Elixir.Postgrex.Protocol'"
],
"programFiles": [
"lib/postgrex.ex",
"lib/postgrex/protocol.ex"
],
"programRoutines": [
{
"name": "'Elixir.Postgrex':stream/4"
},
{
"name": "'Elixir.Postgrex.Protocol':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": "[email protected]",
"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"
]
}
]
}