{"id":"CVE-2026-116316","kind":"vulnerability","aliases":["CVE-2026-116316"],"related":[],"title":"PostgreSQL: temporary-schema type trick lets an object creator run SQL as caller","description":"Improper protection of alternate path in PostgreSQL security-restricted operations allows an object creator to execute arbitrary SQL as the operation's caller, via a domain, enum, or range type created in pg_temp.  The victim session must later run a query containing an unqualified type name, e.g. \"SELECT '1'::bigint\"; autovacuum and other common security-restricted operation users do not do so, so they are unaffected.  Versions before PostgreSQL 18.7, 17.12, 16.16, 15.20, and 14.25 are affected.","summary":"PostgreSQL does not fully protect an alternate code path in security-restricted operations, so a user who creates a domain, enum, or range type in a pg_temp schema can run arbitrary SQL as whoever triggers that operation. The victim session must later run a query with an unqualified type name, such as SELECT '1'::bigint, and autovacuum and other common background users are not affected.","severity":"high","cvss":8.8,"epss":null,"exploited":false,"exploited_at":null,"products":[],"ecosystems":[],"tags":["database","postgresql","runtime","self-hosted"],"not_affected_if":["managed-hosting","patched-version","trusted-users-only"],"how_to_check":"- Run `SELECT version();` in psql and compare against the fixed versions below.\n- Check whether untrusted users can create objects in their own temporary schemas on the server.","fix":"- PostgreSQL `18.7`\n- PostgreSQL `17.12`\n- PostgreSQL `16.16`\n- PostgreSQL `15.20`\n- PostgreSQL `14.25`","status":"open","published_at":"2026-11-12T15:17:39+00:00","first_seen_at":"2026-11-12T15:41:54+00:00","triaged_at":"2026-11-12T15:43:35+00:00","updated_at":"2026-11-12T15:43:35+00:00","category":"runtime","confidence":0.7,"triage":{"at":"2026-11-12T15:43:35Z","model":"claude-haiku-5-5","output":{"fix":"- PostgreSQL `18.7`\n- PostgreSQL `17.12`\n- PostgreSQL `16.16`\n- PostgreSQL `15.20`\n- PostgreSQL `14.25`","reach":"network","title":"PostgreSQL: temporary-schema type trick lets an object creator run SQL as caller","impact":"high","summary":"PostgreSQL does not fully protect an alternate code path in security-restricted operations, so a user who creates a domain, enum, or range type in a pg_temp schema can run arbitrary SQL as whoever triggers that operation. The victim session must later run a query with an unqualified type name, such as SELECT '1'::bigint, and autovacuum and other common background users are not affected.","audience":"businesses","category":"runtime","nicknames":[],"who_cares":["postgresql","self-hosted","database"],"confidence":0.7,"fix_status":"available","needs_auth":"yes","worst_case":"arbitrary SQL runs as the victim session's caller","analyst_note":"","how_to_check":"- Run `SELECT version();` in psql and compare against the fixed versions below.\n- Check whether untrusted users can create objects in their own temporary schemas on the server.","plain_action":"","product_name":"","needs_analyst":false,"not_affected_if":["patched-version","trusted-users-only","managed-hosting"],"who_is_affected":"Servers running PostgreSQL before 18.7, 17.12, 16.16, 15.20, or 14.25 where users other than trusted administrators can connect and create objects. The victim must run a query with an unqualified type name in a session, so ordinary background jobs such as autovacuum are not exposed. Teams on managed PostgreSQL services should check the provider's patch notes.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"unknown","severity_if_unknown":"high"},"cost_usd":0.00078,"input_tokens":4626,"output_tokens":634,"severity_before":"high"},"analyst_status":null,"analyst_note":null,"search":"'-116316':17A,20A '-2026':16A,19A '1':82B,144C '14.25':171C '15.20':169C '16.16':168C '17.12':167C '18.7':166C 'affect':93B,173C 'allow':105C 'altern':33B,97C 'arbitrari':59B,111C 'autovacuum':85B,146C 'background':89B 'bigint':83B,145C 'caller':14A,117C 'code':34B 'common':88B,149C 'contain':137C 'creat':45B,125C 'creator':10A,108C 'cve':15A,18A 'databas':21B 'domain':47B,120C 'e.g':142C 'enum':48B,121C 'execut':110C 'fulli':30B 'host':26B 'improp':94C 'later':70B,133C 'let':7A 'must':69B,132C 'name':78B,141C 'object':9A,107C 'oper':40B,65B,104C,115C,153C 'path':35B,98C 'pg':54B,127C 'postgresql':1A,22B,27B,100C,165C 'protect':31B,95C 'queri':73B,136C 'rang':50B,123C 'restrict':39B,103C,152C 'run':11A,58B,71B,134C 'runtim':23B 'schema':4A,56B 'secur':38B,102C,151C 'security-restrict':37B,101C,150C 'select':81B,143C 'self':25B 'self-host':24B 'session':68B,131C 'sql':12A,60B,112C 'temp':55B,128C 'temporari':3A 'temporary-schema':2A 'trick':6A 'trigger':63B 'type':5A,51B,77B,124C,140C 'unaffect':162C 'unqualifi':76B,139C 'user':43B,90B,154C 'version':163C 'via':118C 'victim':67B,130C 'whoever':62B","nicknames":[],"mitigations":[],"who_affected":"Servers running PostgreSQL before 18.7, 17.12, 16.16, 15.20, or 14.25 where users other than trusted administrators can connect and create objects. The victim must run a query with an unqualified type name in a session, so ordinary background jobs such as autovacuum are not exposed. Teams on managed PostgreSQL services should check the provider's patch notes.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"businesses","plain_action":null,"pkeys":[],"ptokens":[],"labels":["database","high","postgresql","runtime","selfhosted"],"campaign_type":null,"search_a":"'-116316':17A,20A '-2026':16A,19A 'caller':14A 'creator':10A 'cve':15A,18A 'let':7A 'object':9A 'postgresql':1A 'run':11A 'schema':4A 'sql':12A 'temporari':3A 'temporary-schema':2A 'trick':6A 'type':5A","search_b":"'1':82B 'affect':93B 'altern':33B 'arbitrari':59B 'autovacuum':85B 'background':89B 'bigint':83B 'code':34B 'common':88B 'creat':45B 'databas':21B 'domain':47B 'enum':48B 'fulli':30B 'host':26B 'later':70B 'must':69B 'name':78B 'oper':40B,65B 'path':35B 'pg':54B 'postgresql':22B,27B 'protect':31B 'queri':73B 'rang':50B 'restrict':39B 'run':58B,71B 'runtim':23B 'schema':56B 'secur':38B 'security-restrict':37B 'select':81B 'self':25B 'self-host':24B 'session':68B 'sql':60B 'temp':55B 'trigger':63B 'type':51B,77B 'unqualifi':76B 'user':43B,90B 'victim':67B 'whoever':62B","search_c":"'1':144C '14.25':171C '15.20':169C '16.16':168C '17.12':167C '18.7':166C 'affect':173C 'allow':105C 'altern':97C 'arbitrari':111C 'autovacuum':146C 'bigint':145C 'caller':117C 'common':149C 'contain':137C 'creat':125C 'creator':108C 'domain':120C 'e.g':142C 'enum':121C 'execut':110C 'improp':94C 'later':133C 'must':132C 'name':141C 'object':107C 'oper':104C,115C,153C 'path':98C 'pg':127C 'postgresql':100C,165C 'protect':95C 'queri':136C 'rang':123C 'restrict':103C,152C 'run':134C 'secur':102C,151C 'security-restrict':101C,150C 'select':143C 'session':131C 'sql':112C 'temp':128C 'type':124C,140C 'unaffect':162C 'unqualifi':139C 'user':154C 'version':163C 'via':118C 'victim':130C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2026-11-12T15:17:39+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","cvss_by":"f86ef6dc-4d3a-42ad-8f28-e6d5547a5007","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-116316","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-116316","severity":null,"published_at":"2026-11-12T15:17:39+00:00","modified_at":"2026-11-12T15:17:39+00:00","first_seen_at":"2026-11-12T15:41:54+00:00","fetched_at":"2026-11-12T15:41:54+00:00","note":null}],"documents":[],"disclosures":[],"exploit_sources":[],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}