Skip to content

v1.0.8

Choose a tag to compare

@rajsuvariya-stripe rajsuvariya-stripe released this 28 Jul 15:07
· 1 commit to main since this release
v1.0.8
0e16b30

Security fix

Fixes search_path shadowing in bigint-to-timestamp column migrations (CVE-2018-1058, #298).

Bigint → timestamp USING clause (sql_generator.go)

When migrating a bigint column to timestamp without time zone, pg-schema-diff emits a to_timestamp() call in the ALTER COLUMN ... USING clause. An unqualified call resolves via search_path, so a user with CREATE on a schema can plant shadow functions that run during apply instead of the built-ins.

Fix: emit a fully qualified expression:

pg_catalog.to_timestamp(
  col::pg_catalog.float8 OPERATOR(pg_catalog./) 1000.0::pg_catalog.float8
)

What's Changed

  • fix: qualify pg_catalog.to_timestamp in bigint-to-timestamp migrations (#298)

Full Changelog: v1.0.7...v1.0.8