Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions sql/pg_clickhouse.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ RETURNS TEXT
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;

-- clickhouse_raw_query accepts an arbitrary connection string, including
-- any host the caller chooses. Leaving it executable by PUBLIC would
-- allow any database user to reach internal services (metadata endpoints,
-- private APIs, etc.) from the PostgreSQL server — a classic SSRF vector.
-- Grant it back only to roles that legitimately need ad-hoc ClickHouse
-- access (e.g. a dedicated clickhouse_admin role).
REVOKE EXECUTE ON FUNCTION clickhouse_raw_query(text, text) FROM PUBLIC;

CREATE FUNCTION clickhouse_fdw_validator(text[], oid)
RETURNS VOID
AS 'MODULE_PATHNAME'
Expand Down