{"id":"CVE-2023-39417","year":2023,"sequence":39417,"component":"core server","score":7.5,"cvss_version":"3.0","vector":"AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","first_published":"2023-08-10","source_url":"https://www.postgresql.org/support/security/CVE-2023-39417/","facts":{"affected":{"11":"11","12":"12","13":"13","14":"14","15":"15"},"component":"core server","cvss_version":"3.0","description_en":"An extension script is vulnerable if it uses @extowner@ , @extschema@ , or @extschema:...@ inside a quoting construct (dollar quoting, '' , or \"\" ). No bundled extension is vulnerable. Vulnerable uses do appear in a documentation example and in non-bundled extensions. Hence, the attack prerequisite is an administrator having installed files of a vulnerable, trusted, non-bundled extension. Subject to that prerequisite, this enables an attacker having database-level CREATE privilege to execute arbitrary code as the bootstrap superuser. PostgreSQL will block this attack in the core server, so there's no need to modify individual extensions.\n\nThe PostgreSQL project thanks Micah Gates, Valerie Woolard, Tim Carey-Smith, and Christoph Berg for reporting this problem.","first_published":"2023-08-10","fixed":{"11":"11.21","12":"12.16","13":"13.12","14":"14.9","15":"15.4"},"id":"CVE-2023-39417","introduced":{},"published":{"11":"2023-08-10","12":"2023-08-10","13":"2023-08-10","14":"2023-08-10","15":"2023-08-10"},"score":7.5,"title":"Extension script @substitutions@ within quoting allow SQL injection","url":"https://www.postgresql.org/support/security/CVE-2023-39417/","vector":"AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"},"reviewed_hash":"6a65a7884245936f6adaef8709d290d460e999dfce1ad78734fa7c9a324ed325","source_hash":"965b9e2323feab543f3cbeb74c418c3a5b43cbefc6594d2862ff0d24dcf8e6a2","text":{"locale":"en","title":"Extension script @substitutions@ within quoting allow SQL injection","description":"An extension script is vulnerable if it uses @extowner@ , @extschema@ , or @extschema:...@ inside a quoting construct (dollar quoting, '' , or \"\" ). No bundled extension is vulnerable. Vulnerable uses do appear in a documentation example and in non-bundled extensions. Hence, the attack prerequisite is an administrator having installed files of a vulnerable, trusted, non-bundled extension. Subject to that prerequisite, this enables an attacker having database-level CREATE privilege to execute arbitrary code as the bootstrap superuser. PostgreSQL will block this attack in the core server, so there's no need to modify individual extensions.\n\nThe PostgreSQL project thanks Micah Gates, Valerie Woolard, Tim Carey-Smith, and Christoph Berg for reporting this problem.","details":null,"format":"plain","provenance":{"fetched_at":"2026-09-26T10:56:06+00:00","path":"compare/security.json","root":"source-data","sha256":"6a65a7884245936f6adaef8709d290d460e999dfce1ad78734fa7c9a324ed325","source_archive_sha256":"8d8ad63581e1d27b3a0f995ded3feb81c265e38b2ac652eb22f022f52c2240ec","source_revision":"004bc292ee31c11f9a41ab007e9d8116bce29a71","source_url":"https://www.postgresql.org/support/security/"},"text_hash":"be96d0494dbb014250011eeb18e01a5e091cde76bb8b1555d7fafa61ccc8614d"},"locales":["en","zh-Hans"],"fixes":[{"major":"11","fixed_version":"11.21","introduced":null,"published_date":"2023-08-10","facts":{"fixed":"11.21","introduced":null,"published":"2023-08-10"}},{"major":"12","fixed_version":"12.16","introduced":null,"published_date":"2023-08-10","facts":{"fixed":"12.16","introduced":null,"published":"2023-08-10"}},{"major":"13","fixed_version":"13.12","introduced":null,"published_date":"2023-08-10","facts":{"fixed":"13.12","introduced":null,"published":"2023-08-10"}},{"major":"14","fixed_version":"14.9","introduced":null,"published_date":"2023-08-10","facts":{"fixed":"14.9","introduced":null,"published":"2023-08-10"}},{"major":"15","fixed_version":"15.4","introduced":null,"published_date":"2023-08-10","facts":{"fixed":"15.4","introduced":null,"published":"2023-08-10"}}],"legacy":[{"source":"center","source_id":21,"observed_at":"2026-10-03 12:08:35.169032+08","raw":{"id":21,"cve":"2023-39417","public":true,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","details":null,"component":"core server","cvenumber":202339417,"description":"扩展脚本中位于引号内的 @substitutions@ 允许 SQL 注入","detailslink":"https://access.redhat.com/security/cve/CVE-2023-39417","legacyscore":"","newspost_id":null},"fixes":[{"source_id":78,"source_version_id":28,"major":"15","fixed_minor":4,"raw":{"id":78,"patch_id":21,"version_id":28,"fixed_minor":4},"version_raw":{"id":28,"tree":15.0,"current":false,"docsgit":"","eoldate":"2027-11-11","reldate":"2026-08-13","testing":0,"supported":true,"docsloaded":"2026-09-27T08:10:47.078613+08:00","latestminor":19,"firstreldate":"2022-10-13"}},{"source_id":79,"source_version_id":27,"major":"14","fixed_minor":9,"raw":{"id":79,"patch_id":21,"version_id":27,"fixed_minor":9},"version_raw":{"id":27,"tree":14.0,"current":false,"docsgit":"","eoldate":"2026-11-12","reldate":"2026-08-13","testing":0,"supported":true,"docsloaded":"2026-09-27T08:10:47.078613+08:00","latestminor":24,"firstreldate":"2021-09-30"}}]},{"source":"pgweb","source_id":21,"observed_at":"2026-10-03 12:08:55.967155+08","raw":{"id":21,"cve":"2023-39417","public":true,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","details":null,"component":"core server","cvenumber":202339417,"description":"扩展脚本中位于引号内的 @substitutions@ 允许 SQL 注入","detailslink":"https://access.redhat.com/security/cve/CVE-2023-39417","legacyscore":"","newspost_id":null},"fixes":[{"source_id":78,"source_version_id":28,"major":"15","fixed_minor":4,"raw":{"id":78,"patch_id":21,"version_id":28,"fixed_minor":4},"version_raw":{"id":28,"tree":15.0,"current":false,"docsgit":"","eoldate":"2027-11-11","reldate":"2026-08-13","testing":0,"supported":true,"docsloaded":"2026-09-27T00:10:45.258078+08:00","latestminor":19,"firstreldate":"2022-10-13"}},{"source_id":79,"source_version_id":27,"major":"14","fixed_minor":9,"raw":{"id":79,"patch_id":21,"version_id":27,"fixed_minor":9},"version_raw":{"id":27,"tree":14.0,"current":false,"docsgit":"","eoldate":"2026-11-12","reldate":"2026-08-13","testing":0,"supported":true,"docsloaded":"2026-09-27T00:10:45.258078+08:00","latestminor":24,"firstreldate":"2021-09-30"}}]}]}
