SQL sent with a public key can no longer change its database role or the signed-in user, and the storage API shows only safe file types in the browser.
Fixed
SQL with a public key stays in its role. SQL sent with the anon key, or by a signed-in user through it, can no longer call set_config() in any form. It also can no longer call a function that runs a SQL string: query_to_xml(), cursor_to_xml() and their variants, and dblink. Through these, such SQL could change its database role or the user it runs as. The service key and the dashboard SQL editor are unchanged, and reading settings with current_setting() still works. Thanks to the KolayAcademy team for the report.
Uploaded files cannot run as web pages. The storage API now shows only images (not SVG), video, audio, fonts, PDF, plain text, CSV and JSON in the browser. Every other type is sent as a download of raw bytes, whatever type it was uploaded with. That includes HTML, SVG and XML, and files uploaded before the earlier upload rule. Responses also tell the browser not to run scripts in them.