{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2026-66838","id":"CVE-2026-66838","title":"SQL injection via the :comment option in Postgrex.stream/4","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","descriptionLong":"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.","published":"2026-08-07T12:20:02.376Z","updated":"2026-11-19T10:00:23.687240649Z","reserved":"2026-08-06T14:00:01.865Z","status":"Modified","rejected":false,"assigner":"EEF","metric":{"version":"4.0","score":5.9,"vector":"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","rating":"medium","source":"EEF"},"metrics":[{"version":"4.0","score":5.9,"vector":"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","rating":"medium","source":"EEF"},{"version":"4.0","score":5.9,"vector":"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","rating":"medium","source":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db"},{"version":"4.0","score":null,"vector":"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","rating":"unrated","source":"OSV"},{"version":"3.1","score":8.2,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N","rating":"high","source":"NVD"}],"rating":"medium","products":["elixir-ecto postgrex"],"affectedProducts":[{"vendor":"elixir-ecto","product":"postgrex","defaultStatus":"unaffected","versions":[{"lessThan":"0.22.4","status":"affected","version":"0.19.3","versionType":"semver"}],"platforms":[]},{"vendor":"elixir-ecto","product":"postgrex","defaultStatus":"unaffected","versions":[{"changes":[{"at":"e1ecba618ddea4cee2556bd6ad9b6285e05f9d3c","status":"unaffected"},{"at":"4011be852c99dc61ddb98cb01aa41e8775a0e3dd","status":"unaffected"}],"lessThan":"*","status":"affected","version":"4971a2722fa72f8e1b54a2c403cad4c43916e36d","versionType":"git"}],"platforms":[]}],"packages":[],"cwes":["CWE-89"],"aliases":["EEF-CVE-2026-66838","GHSA-3gww-3f36-2388"],"references":[{"url":"https://github.com/elixir-ecto/ecto/security/advisories/GHSA-3gww-3f36-2388","tags":["vendor-advisory","related","exploit","Exploit","Patch","Vendor Advisory","advisory"]},{"url":"https://cna.erlef.org/cves/CVE-2026-66838.html","tags":["related","Patch","Third Party Advisory","web"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-66838","tags":["related","Patch","Third Party Advisory","web"]},{"url":"https://github.com/elixir-ecto/postgrex/commit/4971a2722fa72f8e1b54a2c403cad4c43916e36d","tags":["related","fix"]},{"url":"https://github.com/elixir-ecto/postgrex/commit/e1ecba618ddea4cee2556bd6ad9b6285e05f9d3c","tags":["patch","Patch","fix"]},{"url":"https://github.com/elixir-ecto/postgrex/commit/4011be852c99dc61ddb98cb01aa41e8775a0e3dd","tags":["patch","Patch","fix"]},{"url":"https://github.com","tags":["web"]},{"url":"https://repo.hex.pm","tags":["web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/66xxx/CVE-2026-66838.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-66838","tags":["advisory"]},{"url":"https://github.com/elixir-ecto/postgrex","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial"},"epss":0.00224,"epssPercentile":0.13137,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-66838","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-66838","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2026-66838","ok":true,"note":"0 packages"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-66838","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}