{"answers":{"affected":"1 open source package ship an affected version, including postgrex. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-66838 exists.","fix":"Upgrade postgrex to 0.22.4 or later.","what":"CVE-2026-66838 is a medium-severity SQL injection vulnerability in elixir-ecto postgrex, published on 7 Aug 2026. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2026-66838 and fix it if it is affected.\n\nWhat it is: CVE-2026-66838 is a medium-severity SQL injection vulnerability in elixir-ecto postgrex, published on 7 Aug 2026. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-66838 exists.\n\nAffected packages and fixed versions:\n- postgrex (Hex): affected from 0.19.3; fixed in 0.22.4\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-66838/ (Markdown: https://insights.sbomify.com/CVE-2026-66838/index.md)","id":"CVE-2026-66838","markdown":"https://insights.sbomify.com/CVE-2026-66838/index.md","name":"CVE-2026-66838","record":{"aliases":["EEF-CVE-2026-66838","GHSA-3gww-3f36-2388"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution","data_read","data_modify"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Elixir Postgrex library","requires_auth":"none","summary":"Attackers can inject SQL commands via the comment option in Postgrex.stream/4, allowing execution of arbitrary clauses under the database connection's role.","user_interaction":"not_required","vuln_class":"sql_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"EEF","cpe":[{"product":"postgrex","vendor":"elixir-ecto"}],"cvss":{"score":5.9,"severity":"medium","source":"cna","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","version":"4.0"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"}],"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.\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.","ecosystems":["Hex"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"SQL injection via the :comment option in Postgrex.stream/4","id":"CVE-2026-66838","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Hex","product":null,"products":[],"type":"sql_injection","year":"2026"},"n_packages":1,"n_references":5,"next":{"headline":"Privilege escalation in NetKids iMark","id":"CVE-2026-66839"},"packages":[{"ecosystem":"Hex","fixed":["0.22.4"],"introduced":["0.19.3"],"last_affected":[],"package":"postgrex","purl":"pkg:hex/postgrex","source":"EEF-CVE-2026-66838"}],"prev":{"headline":"Apache Thrift: PHP accelerator sizes a stack buffer from a wire-controlled string length","id":"CVE-2026-66837"},"products":["postgrex"],"published":"2026-08-07","related":[{"cvss_score":7.5,"headline":"SQL injection via channel name in Postgrex.Notifications.listen/3 and unlisten/3","id":"CVE-2026-32687","kev_date_added":null,"published":"2026-05-12"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"Erlang Ecosystem Foundation","prefix":"EEF"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2026-08-07","vendors":["elixir-ecto"]},"summary":"Attackers can inject SQL commands via the comment option in Postgrex.stream/4, allowing execution of arbitrary clauses under the database connection's role.","url":"https://insights.sbomify.com/CVE-2026-66838/"}